mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-01 00:20:07 +00:00
* wording improvement * wording improvement for docs * docs: wording * wording * user account only: docs * Edited * Edited
26 lines
735 B
JavaScript
26 lines
735 B
JavaScript
const Action = require('./Action');
|
|
const { Events } = require('../../util/Constants');
|
|
|
|
class MessageReactionRemoveAll extends Action {
|
|
handle(data) {
|
|
const channel = this.client.channels.get(data.channel_id);
|
|
if (!channel || channel.type === 'voice') return false;
|
|
|
|
const message = channel.messages.get(data.message_id);
|
|
if (!message) return false;
|
|
|
|
message.reactions.clear();
|
|
this.client.emit(Events.MESSAGE_REACTION_REMOVE_ALL, message);
|
|
|
|
return { message };
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Emitted whenever all reactions are removed from a cached message.
|
|
* @event Client#messageReactionRemoveAll
|
|
* @param {Message} message The message the reactions were removed from
|
|
*/
|
|
|
|
module.exports = MessageReactionRemoveAll;
|