Skip to content

Commit 6caeaeb

Browse files
ArthurNotSugdenSpaceEEC
authored
fix(MessageReactionAdd): prevent double messageReactionAdd triggering (#4682)
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com> Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
1 parent 290938b commit 6caeaeb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/client/actions/MessageReactionAdd.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class MessageReactionAdd extends Action {
2828

2929
// Verify reaction
3030
if (message.partial && !this.client.options.partials.includes(PartialTypes.REACTION)) return false;
31+
const existing = message.reactions.cache.get(data.emoji.id || data.emoji.name);
32+
if (existing && existing.users.cache.has(user.id)) return { message, reaction: existing, user };
3133
const reaction = message.reactions.add({
3234
emoji: data.emoji,
3335
count: message.partial ? null : 0,

0 commit comments

Comments
 (0)