From 3b9b06227e3483ebd6a690e72e5b2dd4197fa517 Mon Sep 17 00:00:00 2001 From: Michael Huang Date: Fri, 30 Dec 2016 18:06:05 -0800 Subject: [PATCH] Fix _removeReaction's reaction lookup (#1045) * Fix _removeReaction's `this.reactions` lookup * Use emoji.identifier for reaction collection keys --- src/structures/Message.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/Message.js b/src/structures/Message.js index 85a17c549..51b2314f1 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -535,7 +535,7 @@ class Message { } _addReaction(emoji, user) { - const emojiID = emoji.id ? `${emoji.name}:${emoji.id}` : emoji.name; + const emojiID = emoji.identifier; let reaction; if (this.reactions.has(emojiID)) { reaction = this.reactions.get(emojiID); @@ -553,7 +553,7 @@ class Message { } _removeReaction(emoji, user) { - const emojiID = emoji.id || emoji; + const emojiID = emoji.identifier; if (this.reactions.has(emojiID)) { const reaction = this.reactions.get(emojiID); if (reaction.users.has(user.id)) {