added updating of messages

This commit is contained in:
hydrabolt
2015-08-15 22:34:09 +01:00
parent 44a9844e0c
commit 5685c5f4ce
5 changed files with 208 additions and 4 deletions

View File

@@ -133,6 +133,21 @@ Internal.XHR.deleteMessage = function( token, channelID, messageID, callback ) {
} );
}
Internal.XHR.updateMessage = function( token, channelID, messageID, messageParameters, callback ){
request
.patch(Endpoints.CHANNELS + "/" + channelID + "/messages/" + messageID)
.set( "authorization", token )
.send( messageParameters )
.end(function(err, res){
if ( err ) {
callback( err );
} else {
callback( null, res.body );
}
});
}
Internal.XHR.getChannelLogs = function( token, channelID, amount, callback ) {
request
.get( Endpoints.CHANNELS + "/" + channelID + "/messages?limit=" + amount )