From 84aab1021add0ba3ad2b55b100fb0344c2c0f18b Mon Sep 17 00:00:00 2001 From: Drahcirius Date: Tue, 11 Apr 2017 13:10:14 -0400 Subject: [PATCH] reaction remove fix (#1366) --- src/client/rest/RESTMethods.js | 6 +++--- src/structures/MessageReaction.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/rest/RESTMethods.js b/src/client/rest/RESTMethods.js index 28843b26e..91cbd25a1 100644 --- a/src/client/rest/RESTMethods.js +++ b/src/client/rest/RESTMethods.js @@ -815,11 +815,11 @@ class RESTMethods { ); } - removeMessageReaction(message, emoji, user) { - const endpoint = Endpoints.Message(message).Reaction(emoji).User(user === this.client.user.id ? '@me' : user.id); + removeMessageReaction(message, emoji, userID) { + const endpoint = Endpoints.Message(message).Reaction(emoji).User(userID === this.client.user.id ? '@me' : userID); return this.rest.makeRequest('delete', endpoint, true).then(() => this.client.actions.MessageReactionRemove.handle({ - user_id: user, + user_id: userID, message_id: message.id, emoji: Util.parseEmoji(emoji), channel_id: message.channel.id, diff --git a/src/structures/MessageReaction.js b/src/structures/MessageReaction.js index 2d1777b28..efb785655 100644 --- a/src/structures/MessageReaction.js +++ b/src/structures/MessageReaction.js @@ -62,10 +62,10 @@ class MessageReaction { */ remove(user = this.message.client.user) { const message = this.message; - user = this.message.client.resolver.resolveUserID(user); - if (!user) return Promise.reject(new Error('Couldn\'t resolve the user ID to remove from the reaction.')); + const userID = this.message.client.resolver.resolveUserID(user); + if (!userID) return Promise.reject(new Error('Couldn\'t resolve the user ID to remove from the reaction.')); return message.client.rest.methods.removeMessageReaction( - message, this.emoji.identifier, user + message, this.emoji.identifier, userID ); }