From 776dda9bff7868ce0eec2e0e07523e60ba2c6849 Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Fri, 14 Aug 2015 21:03:34 +0100 Subject: [PATCH] small fixes --- hydrabot/hydrabot.js | 6 +++--- index.js | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hydrabot/hydrabot.js b/hydrabot/hydrabot.js index 92da060e7..afd8be93c 100644 --- a/hydrabot/hydrabot.js +++ b/hydrabot/hydrabot.js @@ -4,8 +4,6 @@ var Discord = require( "../" ); exports.Discord = Discord; -exports.LOL = "CHING CHONG UNTOUCHED"; - // Load the config file. If you have not already, make one that follows the // structure : { "email" : "discordEmail", "password" : "discordPassword" } var BotConfig = require( "./config.json" ); @@ -30,9 +28,11 @@ hydrabot.login( BotConfig.email, BotConfig.password ); console.log( "Starting up..." ); +var time = Date.now(); + // When the bot is ready to go, output to the console hydrabot.on( "ready", function() { - console.log( "Ready!" ); + console.log( "Ready in "+ (Date.now() - time) +"ms!" ); } ); // When the bot gets disconnected, exit. diff --git a/index.js b/index.js index 2fd1a8454..7a6b21b7d 100644 --- a/index.js +++ b/index.js @@ -78,6 +78,10 @@ exports.Client.prototype.cacheServer = function( id, cb, members ) { .set( "authorization", self.token ) .end( function( err, res ) { + if(err){ + throw err; + } + var channelList = res.body; for ( channel of channelList ) { server.channels.add( new Channel( channel, server ) );