mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
added updating of messages
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user