From 89b1f4aaae47bf7acd0454d5da50c617e16e1f76 Mon Sep 17 00:00:00 2001 From: Alee Date: Sun, 15 Apr 2018 00:07:40 -0400 Subject: Debugging --- bot_discord.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bot_discord.js') diff --git a/bot_discord.js b/bot_discord.js index 8700573..b9d7f2f 100644 --- a/bot_discord.js +++ b/bot_discord.js @@ -144,6 +144,17 @@ client.on("error", error => { log(error); }); +if (process.argv.indexOf("--debug") == -1) { + log("Running AleeBot without --debug command line flag. Debug output disabled."); +} else { + + client.on('debug', function(info) { + log(info); + }); + client.on('warn', function(info) { + log(info); + }); +} client.login(config.abtoken).catch(function() { log('[X] Login failed. Please contact Alee14#9928 or email him at alee14498@gmail.com.'); -- cgit v1.2.3