Struct twilight_http::request::channel::message::GetChannelMessages
source · 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
sourceimpl<'a> GetChannelMessages<'a>
impl<'a> GetChannelMessages<'a>
pub const fn after(
self,
message_id: Id<MessageMarker>
) -> GetChannelMessagesConfigured<'a>
pub const fn around(
self,
message_id: Id<MessageMarker>
) -> GetChannelMessagesConfigured<'a>
pub const fn before(
self,
message_id: Id<MessageMarker>
) -> GetChannelMessagesConfigured<'a>
sourcepub const fn limit(self, limit: u16) -> Result<Self, ValidationError>
pub const fn limit(self, limit: u16) -> Result<Self, ValidationError>
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
sourceimpl IntoFuture for GetChannelMessages<'_>
impl IntoFuture for GetChannelMessages<'_>
type Output = Result<Response<ListBody<Message>>, Error>
type Output = Result<Response<ListBody<Message>>, Error>
The output that the future will produce on completion.
type IntoFuture = ResponseFuture<ListBody<Message>>
type IntoFuture = ResponseFuture<ListBody<Message>>
Which kind of future are we turning this into?
sourcefn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
sourceimpl TryIntoRequest for GetChannelMessages<'_>
impl TryIntoRequest for GetChannelMessages<'_>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more