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:
Arthur
2020-08-12 21:24:45 +02:00
committed by GitHub
parent 290938bf80
commit 6caeaeb391

View File

@@ -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,