feat: Give removed MessageReactions on messageReactionRemoveAll event (#6607)

Co-authored-by: D Trombett <maxtromb.dt@gmail.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
Suneet Tipirneni
2021-09-10 14:32:05 -04:00
committed by GitHub
parent 1b016a30c8
commit be8912a421
2 changed files with 6 additions and 2 deletions

View File

@@ -13,8 +13,11 @@ class MessageReactionRemoveAll extends Action {
const message = this.getMessage(data, channel);
if (!message) return false;
// Copy removed reactions to emit for the event.
const removed = message.reactions.cache.clone();
message.reactions.cache.clear();
this.client.emit(Events.MESSAGE_REACTION_REMOVE_ALL, message);
this.client.emit(Events.MESSAGE_REACTION_REMOVE_ALL, message, removed);
return { message };
}
@@ -24,6 +27,7 @@ class MessageReactionRemoveAll extends Action {
* Emitted whenever all reactions are removed from a cached message.
* @event Client#messageReactionRemoveAll
* @param {Message} message The message the reactions were removed from
* @param {Collection<string|Snowflake, MessageReaction>} reactions The cached message reactions that were removed.
*/
module.exports = MessageReactionRemoveAll;