mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-03 01:20:07 +00:00
* Remove GroupDMChannels they sparked no joy * Start partials for message deletion * MessageUpdate partials * Add partials as an opt-in client option * Add fetch() to Message * Message.author should never be undefined * Fix channels being the wrong type * Allow fetching channels * Refactor and add reaction add partials * Reaction remove partials * Check for emoji first * fix message fetching janky * User partials in audit logs * refactor overwrite code * guild member partials * partials as a whitelist * document GuildMember#fetch * fix: check whether a structure is a partial, not whether cache is true * typings: Updated for latest commit (#3075) * partials: fix messageUpdate behaviour (now "old" message can be partial) * partials: add warnings and docs * partials: add partials to index.yml * partials: tighten "partial" definitions * partials: fix embed-only messages counting as partials
30 lines
767 B
JavaScript
30 lines
767 B
JavaScript
'use strict';
|
|
|
|
const Action = require('./Action');
|
|
const { Events } = require('../../util/Constants');
|
|
|
|
class MessageReactionRemoveAll extends Action {
|
|
handle(data) {
|
|
// Verify channel
|
|
const channel = this.getChannel(data);
|
|
if (!channel || channel.type === 'voice') return false;
|
|
|
|
// Verify message
|
|
const message = this.getMessage(data, channel);
|
|
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;
|