From 9aed52170cb14ed94d28a850674dd529452f7152 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Mon, 5 Apr 2021 00:14:27 -0500 Subject: [PATCH] Use conditional statement to decide whether to use ID or name for emoji --- bot.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bot.js b/bot.js index f12fbce..047480e 100644 --- a/bot.js +++ b/bot.js @@ -798,8 +798,9 @@ client.on('messageReactionAdd', (messageReaction, user) => { messageReaction.message.channel.messages.fetch(messageReaction.message.id) .then(message => { const emoji = messageReaction.emoji.name; - const emojiIdentifier = messageReaction.emoji.identifier; - const numEmoji = message.reactions.cache.get(emojiIdentifier).count; + const emojiID = messageReaction.emoji.id; + let numEmoji; + message.reactions.cache.get(emojiID) ? numEmoji = message.reactions.cache.get(emojiID).count : message.reactions.cache.get(emoji).count; const messageReactionAddEmbed = new Discord.MessageEmbed() .setTitle("Reaction Added") .setAuthor(message.author.tag, message.author.avatarURL())