Struct serenity::model::channel::Reaction [−][src]
#[non_exhaustive]pub struct Reaction {
pub channel_id: ChannelId,
pub emoji: ReactionType,
pub message_id: MessageId,
pub user_id: Option<UserId>,
pub guild_id: Option<GuildId>,
pub member: Option<PartialMember>,
}
Expand description
An emoji reaction to a message.
Fields (Non-exhaustive)
This struct is marked as 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.
member: Option<PartialMember>
The optional object of the member which added the reaction.
Implementations
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.
Errors
Returns Error::Http
if the current user lacks permission,
or if the channel no longer exists.
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.
Otherwise returns Error::Http
if the current user lacks permission.
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.
Otherwise returns Error::Http
if the current user lacks permission.
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.
Errors
Returns Error::Http
if the current user lacks permission to
read message history, or if the message was deleted.
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.
Errors
Returns Error::Http
if the user that made the reaction is unable to be
retrieved from the API.
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
Auto Trait Implementations
impl RefUnwindSafe for Reaction
impl UnwindSafe for Reaction
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more