mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
Added joining servers and better message handling
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user