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

Commit

Permalink
Merge pull request #130 from memanlolz/patch-1
Browse files Browse the repository at this point in the history
Added the final reaction endpoint
  • Loading branch information
izy521 authored Jan 4, 2017
2 parents 7f55940 + 1795363 commit 75145a5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,18 @@ DCP.removeReaction = function(input, callback) {
});
};

/**
* Remove all emoji reactions from a message.
* @arg {Object} input
* @arg {Snowflake} input.channelID
* @arg {Snowflake} input.messageID
*/
DCP.removeAllReactions = function(input, callback) {
this._req('delete', Endpoints.MESSAGE_REACTIONS(input.channelID, input.messageID), function(err, res) {
handleResCB("Unable to remove reactions", err, res, callback);
});
};

/* - DiscordClient - Methods - Server Management - */

/**
Expand Down Expand Up @@ -2048,7 +2060,7 @@ function handlevWSClose(voiceSession) {
if (member.decoder) member.decoder.destroy();
});

//Clear intervals and remove listeners
//Clear intervals and remove listeners
clearInterval(voiceSession.wsKeepAlive);
clearInterval(voiceSession.udpKeepAlive);
//TODO: Emit ServerID and Channel ID. For v3
Expand Down Expand Up @@ -2729,7 +2741,7 @@ function Websocket(url, opts) {
},

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

0 comments on commit 75145a5

Please sign in to comment.