mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
feat(MessageReaction): backport removeAll and MessageReactionRemoveEmoji event (#3741)
* Add new action and websocket handler * Add REST method for removing reaction emoji * Update Message#_removeReaction to handle removing whole emoji * Add MessageReaction#removeAll and update typings * Apply uncached user fix
This commit is contained in:
@@ -945,6 +945,17 @@ class RESTMethods {
|
||||
);
|
||||
}
|
||||
|
||||
removeMessageReactionEmoji(message, emoji) {
|
||||
const endpoint = Endpoints.Message(message).Reaction(emoji);
|
||||
return this.rest.makeRequest('delete', endpoint, true).then(() =>
|
||||
this.client.actions.MessageReactionRemoveEmoji.handle({
|
||||
message_id: message.id,
|
||||
emoji: Util.parseEmoji(emoji),
|
||||
channel_id: message.channel.id,
|
||||
}).reaction
|
||||
);
|
||||
}
|
||||
|
||||
removeMessageReactions(message) {
|
||||
return this.rest.makeRequest('delete', Endpoints.Message(message).reactions, true)
|
||||
.then(() => message);
|
||||
|
||||
Reference in New Issue
Block a user