From 6caeaeb391e0e85461e02d9f7c0f2d1e52b62a7f Mon Sep 17 00:00:00 2001 From: Arthur <49537282+arthur-lchl@users.noreply.github.com> Date: Wed, 12 Aug 2020 21:24:45 +0200 Subject: [PATCH] fix(MessageReactionAdd): prevent double messageReactionAdd triggering (#4682) Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com> Co-authored-by: SpaceEEC --- src/client/actions/MessageReactionAdd.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/actions/MessageReactionAdd.js b/src/client/actions/MessageReactionAdd.js index 22287dbd1..92350f14e 100644 --- a/src/client/actions/MessageReactionAdd.js +++ b/src/client/actions/MessageReactionAdd.js @@ -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,