mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(MessageReactionAdd): prevent double messageReactionAdd triggering (#4682)
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com> Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
@@ -28,6 +28,8 @@ class MessageReactionAdd extends Action {
|
||||
|
||||
// Verify reaction
|
||||
if (message.partial && !this.client.options.partials.includes(PartialTypes.REACTION)) return false;
|
||||
const existing = message.reactions.cache.get(data.emoji.id || data.emoji.name);
|
||||
if (existing && existing.users.cache.has(user.id)) return { message, reaction: existing, user };
|
||||
const reaction = message.reactions.add({
|
||||
emoji: data.emoji,
|
||||
count: message.partial ? null : 0,
|
||||
|
||||
Reference in New Issue
Block a user