mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +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
|
// Verify reaction
|
||||||
if (message.partial && !this.client.options.partials.includes(PartialTypes.REACTION)) return false;
|
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({
|
const reaction = message.reactions.add({
|
||||||
emoji: data.emoji,
|
emoji: data.emoji,
|
||||||
count: message.partial ? null : 0,
|
count: message.partial ? null : 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user