Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Added the Delete User Reaction Endpoint #120

Merged
merged 2 commits into from
Nov 27, 2016
Merged

Added the Delete User Reaction Endpoint #120

merged 2 commits into from
Nov 27, 2016

Conversation

RaidAndFade
Copy link
Contributor

Added the Delete User Reaction endpoint to allow bots with the MANAGE_MESSAGES permission to delete another user's reaction.

Added the Delete User Reaction endpoint to allow bots with the MANAGE_MESSAGES permission to delete another user's reaction.
@@ -2689,6 +2703,9 @@ function Websocket(url, opts) {
REACTIONS: function(channelID, messageID, reaction) {
return this.MESSAGE_REACTIONS(channelID, messageID, reaction) + "/@me";
},
USER_REACTIONS: function(channelID, messageID, reaction, userID) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to:

USER_REACTIONS: function(channelID, messageID, reaction, userID) {
    return  this.MESSAGE_REACTIONS(channelID, messageID, reaction) + '/' + ( (!userID || userID === this.id) ? '@me' : userID );
}

, remove the REACTIONS method above, and then replace Endpoints.REACTIONS with Endpoints.USER_REACTIONS on line 390 and 418

Removed the REACTIONS endpoint completely. 
Merged the removeReaction function and the removeUserReaction endpoint into one removeReaction endpoint.
Replaced any trace of the REACTIONS endpoint with the USER_REACTIONS endpoint (on lines 419 and 390)
@RaidAndFade
Copy link
Contributor Author

Changed accordingly. Check the latest COMMIT.

@izy521 izy521 merged commit 4fda6f8 into izy521:master Nov 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants