-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added additional reaction controls to channel_id and message structs #2533
Changes from 2 commits
9a20264
9a385a9
52d1ebe
b1d4692
d4d1425
52862cd
3631f40
90e9195
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -264,6 +264,36 @@ impl Message { | |||||||||
cache_http.http().as_ref().delete_message_reactions(self.channel_id.0, self.id.0).await | ||||||||||
} | ||||||||||
|
||||||||||
/// Remove reaction from the message given an [`Emoji`] or unicode character | ||||||||||
Collin-Swish marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
/// | ||||||||||
/// **Note**: Requires the [Manage Messages] permission, _if_ the current | ||||||||||
/// user did not perform the reaction | ||||||||||
Collin-Swish marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
/// | ||||||||||
/// # Errors | ||||||||||
/// | ||||||||||
/// Returns [`Error::Http`] if the currend user did not perform the reaction, | ||||||||||
/// and lacks permission | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
formatting |
||||||||||
/// | ||||||||||
/// [Manage Messages]: Permissions::MANAGE_MESSAGES | ||||||||||
#[inline] | ||||||||||
pub async fn delete_reaction( | ||||||||||
self, | ||||||||||
cache_http: impl CacheHttp, | ||||||||||
Collin-Swish marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
user_id: Option<UserId>, | ||||||||||
reaction_type: impl Into<ReactionType>, | ||||||||||
) -> Result<()> { | ||||||||||
cache_http | ||||||||||
.http() | ||||||||||
.as_ref() | ||||||||||
.delete_reaction( | ||||||||||
self.channel_id.0, | ||||||||||
self.id.0, | ||||||||||
user_id.map(|uid| uid.0), | ||||||||||
&reaction_type.into(), | ||||||||||
) | ||||||||||
.await | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be reworked to just a wrapper around |
||||||||||
} | ||||||||||
|
||||||||||
/// Deletes all of the [`Reaction`]s of a given emoji associated with the message. | ||||||||||
/// | ||||||||||
/// **Note**: Requires the [Manage Messages] permission. | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should include an
# Errors
section.