Skip to content

Commit

Permalink
reaction remove fix (#1366)
Browse files Browse the repository at this point in the history
  • Loading branch information
Drahcirius authored and amishshah committed Apr 11, 2017
1 parent 25e0048 commit 84aab10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/client/rest/RESTMethods.js
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/structures/MessageReaction.js
Expand Up @@ -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
);
}

Expand Down

0 comments on commit 84aab10

Please sign in to comment.