pub struct GetChannelMessages<'a> { /* private fields */ }
Expand description
Get channel messages, by Id<ChannelMarker>
.
Only one of after
, around
, and before
can be specified at a time.
Once these are specified, the type returned is GetChannelMessagesConfigured
.
If limit
is unspecified, the default set by Discord is 50.
§Examples
use twilight_http::Client;
use twilight_model::id::Id;
let client = Client::new("my token".to_owned());
let channel_id = Id::new(123);
let message_id = Id::new(234);
let messages = client
.channel_messages(channel_id)
.before(message_id)
.limit(6u16)
.await?;
Implementations§
source§impl<'a> GetChannelMessages<'a>
impl<'a> GetChannelMessages<'a>
pub fn after( self, message_id: Id<MessageMarker>, ) -> GetChannelMessagesConfigured<'a>
pub fn around( self, message_id: Id<MessageMarker>, ) -> GetChannelMessagesConfigured<'a>
pub fn before( self, message_id: Id<MessageMarker>, ) -> GetChannelMessagesConfigured<'a>
sourcepub fn limit(self, limit: u16) -> Self
pub fn limit(self, limit: u16) -> Self
Set the maximum number of messages to retrieve.
The minimum is 1 and the maximum is 100.
§Errors
Returns an error of type GetChannelMessages
error type if the amount
is less than 1 or greater than 100.
Trait Implementations§
source§impl IntoFuture for GetChannelMessages<'_>
impl IntoFuture for GetChannelMessages<'_>
source§type Output = Result<Response<ListBody<Message>>, Error>
type Output = Result<Response<ListBody<Message>>, Error>
The output that the future will produce on completion.
source§type IntoFuture = ResponseFuture<ListBody<Message>>
type IntoFuture = ResponseFuture<ListBody<Message>>
Which kind of future are we turning this into?
source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
source§impl TryIntoRequest for GetChannelMessages<'_>
impl TryIntoRequest for GetChannelMessages<'_>
Auto Trait Implementations§
impl<'a> Freeze for GetChannelMessages<'a>
impl<'a> !RefUnwindSafe for GetChannelMessages<'a>
impl<'a> Send for GetChannelMessages<'a>
impl<'a> Sync for GetChannelMessages<'a>
impl<'a> Unpin for GetChannelMessages<'a>
impl<'a> !UnwindSafe for GetChannelMessages<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more