Added joining servers and better message handling

This commit is contained in:
hydrabolt
2015-08-17 21:02:18 +01:00
parent 945fe8f65e
commit 93361925ab
7 changed files with 110 additions and 44 deletions

View File

@@ -24,6 +24,7 @@ var hydrabot = new Discord.Client();
var commandPrefixes = [ "$", "£", "`" ];
// Log the client in using the auth details in config.json
console.time("hydrabotbenchmark");
hydrabot.login( BotConfig.email, BotConfig.password );
console.log( "Starting up..." );
@@ -32,7 +33,7 @@ var time = Date.now();
// When the bot is ready to go, output to the console
hydrabot.on( "ready", function() {
console.log( "Ready in "+ (Date.now() - time) +"ms!" );
console.timeEnd("hydrabotbenchmark");
} );
// When the bot gets disconnected, exit.
@@ -48,12 +49,12 @@ hydrabot.on("messageDelete", function(message){
hydrabot.on("messageUpdate", function(former, edit){
if(former.author.equals(this.user)){
return;
}
if(former){
if(former.author.equals(this.user) || former.content === edit.content){
return;
}
var seconds = Math.round((Date.now() - former.time) / 1000);
var channel = former.channel;