[−][src]Struct serenity::model::channel::Reaction
An emoji reaction to a message.
Fields (Non-exhaustive)
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.channel_id: ChannelId
emoji: ReactionType
The reactive emoji used.
message_id: MessageId
The Id of the Message
that was reacted to.
user_id: Option<UserId>
The Id of the User
that sent the reaction.
Set to None
by Message::react
when cache is not available.
guild_id: Option<GuildId>
The optional Id of the Guild
where the reaction was sent.
Implementations
impl Reaction
[src]
pub async fn channel(&self, cache_http: impl CacheHttp) -> Result<Channel>
[src]
Retrieves the associated the reaction was made in.
If the cache is enabled, this will search for the already-cached channel. If not - or the channel was not found - this will perform a request over the REST API for the channel.
Requires the Read Message History permission.
pub async fn delete(&self, cache_http: impl CacheHttp) -> Result<()>
[src]
Deletes the reaction, but only if the current user is the user who made the reaction or has permission to.
Requires the Manage Messages permission, if the current user did not perform the reaction.
Errors
If the cache
is enabled, then returns a
ModelError::InvalidPermissions
if the current user does not have
the required permissions.
pub async fn delete_all(&self, cache_http: impl CacheHttp) -> Result<()>
[src]
Deletes all reactions from the message with this emoji.
Requires the Manage Messages permission
Errors
If the cache
is enabled, then returns a
ModelError::InvalidPermissions
if the current user does not have
the required permissions.
pub async fn message(&self, http: impl AsRef<Http>) -> Result<Message>
[src]
Retrieves the Message
associated with this reaction.
Requires the Read Message History permission.
Note: This will send a request to the REST API. Prefer maintaining your own message cache or otherwise having the message available if possible.
pub async fn user(&self, cache_http: impl CacheHttp) -> Result<User>
[src]
Retrieves the user that made the reaction.
If the cache is enabled, this will search for the already-cached user. If not - or the user was not found - this will perform a request over the REST API for the user.
pub async fn users<R, U>(
&self,
http: impl AsRef<Http>,
reaction_type: R,
limit: Option<u8>,
after: Option<U>
) -> Result<Vec<User>> where
R: Into<ReactionType>,
U: Into<UserId>,
[src]
&self,
http: impl AsRef<Http>,
reaction_type: R,
limit: Option<u8>,
after: Option<U>
) -> Result<Vec<User>> where
R: Into<ReactionType>,
U: Into<UserId>,
Retrieves the list of User
s who have reacted to a Message
with a
certain Emoji
.
The default limit
is 50
- specify otherwise to receive a different
maximum number of users. The maximum that may be retrieve at a time is
100
, if a greater number is provided then it is automatically reduced.
The optional after
attribute is to retrieve the users after a certain
user. This is useful for pagination.
Requires the Read Message History permission.
Note: This will send a request to the REST API.
Errors
Returns a ModelError::InvalidPermissions
if the current user does
not have the required permissions.
Trait Implementations
impl Clone for Reaction
[src]
impl Debug for Reaction
[src]
impl<'de> Deserialize<'de> for Reaction
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for Reaction
[src]
Auto Trait Implementations
impl RefUnwindSafe for Reaction
[src]
impl Send for Reaction
[src]
impl Sync for Reaction
[src]
impl Unpin for Reaction
[src]
impl UnwindSafe for Reaction
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,