[−][src]Struct serenity::builder::GetMessages
Builds a request for a request to the API to retrieve messages.
This can have 2 different sets of parameters. The first set is around where to get the messages:
after
around
before
These can not be mixed, and the first in the list alphabetically will be
used. If one is not specified, most_recent
will be used.
The fourth parameter is to specify the number of messages to retrieve. This does not need to be called and defaults to a value of 50.
This should be used only for retrieving messages; see
GuildChannel::messages
for examples.
Examples
Creating a GetMessages
builder to retrieve the first 25 messages after the
message with an Id of 158339864557912064
:
use serenity::model::id::{ChannelId, MessageId}; // you can then pass it into a function which retrieves messages: let channel_id = ChannelId(81384788765712384); let _messages = channel_id.messages(&http, |retriever| { retriever.after(MessageId(158339864557912064)).limit(25) })?;
Methods
impl GetMessages
[src]
pub fn after<M: Into<MessageId>>(&mut self, message_id: M) -> &mut Self
[src]
Indicates to retrieve the messages after a specific message, given by its Id.
pub fn around<M: Into<MessageId>>(&mut self, message_id: M) -> &mut Self
[src]
Indicates to retrieve the messages around a specific message in either direction (before+after) the given message.
pub fn before<M: Into<MessageId>>(&mut self, message_id: M) -> &mut Self
[src]
Indicates to retrieve the messages before a specific message, given by its Id.
pub fn limit(&mut self, limit: u64) -> &mut Self
[src]
The maximum number of messages to retrieve for the query.
If this is not specified, a default value of 50 is used.
Note: This field is capped to 100 messages due to a Discord limitation. If an amount larger than 100 is supplied, it will be reduced.
Trait Implementations
impl Clone for GetMessages
[src]
fn clone(&self) -> GetMessages
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for GetMessages
[src]
fn default() -> GetMessages
[src]
impl Debug for GetMessages
[src]
Auto Trait Implementations
impl Sync for GetMessages
impl Send for GetMessages
impl Unpin for GetMessages
impl RefUnwindSafe for GetMessages
impl UnwindSafe for GetMessages
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> DebugAny for T where
T: Any + Debug,
[src]
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
[src]
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
[src]
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
[src]
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
[src]
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Send + Sync> where
T: Send + Sync,
[src]
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
T: Any,