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

@@ -44,6 +44,27 @@ hydrabot.on( "disconnected", function( obj ) {
process.exit( 0 );
} );
hydrabot.on("messageDelete", function(message){
console.log(message);
})
hydrabot.on("messageUpdate", function(former, edit){
if(former.author.equals(this.user)){
return;
}
if(former){
var seconds = Math.round((Date.now() - former.time) / 1000);
var channel = former.channel;
hydrabot.sendMessage(channel, "**"+former.author.username + "** (edit from message "+seconds+" seconds ago):\n " + former.content);
}
})
hydrabot.on( "message", function( message ) {
// if the message doesn't begin with a valid command prefix exit