From a5f04cbb26a3f3dd22b56727965c5f2fc5c02955 Mon Sep 17 00:00:00 2001 From: MSFTserver Date: Fri, 16 Feb 2018 00:57:24 -0800 Subject: [PATCH] fix alias and add swtiching playing game --- bot/bot.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/bot/bot.js b/bot/bot.js index 43fb30e..2b4d4e8 100644 --- a/bot/bot.js +++ b/bot/bot.js @@ -9,7 +9,10 @@ config = config.get('bot'); var aliases; try { aliases = require('./alias.json'); + console.log('aliases') + console.log(aliases) } catch (e) { + console.log('No aliases defined') //No aliases defined aliases = { test: { @@ -27,7 +30,18 @@ bot.on('ready', function() { console.log('Logged in! Serving in ' + bot.guilds.array().length + ' servers'); require('./plugins.js').init(); console.log('type ' + config.prefix + 'help in Discord for a commands list.'); - bot.user.setGame(config.prefix + 'tip'); + bot.user.setActivity(config.prefix + 'Intialized!'); + var text = ['tip', 'multitip', 'roletip']; + var counter = 0; + setInterval(change, 10000); + + function change() { + bot.user.setActivity(config.prefix + text[counter]); + counter++; + if (counter >= text.length) { + counter = 0; + } + } }); bot.on('disconnected', function() { @@ -53,7 +67,7 @@ function checkMessageForCommand(msg, isEdit) { } let alias = aliases[cmdTxt]; if (alias) { - var cmd = alias; + var cmd = commands[alias]; } else { var cmd = commands[cmdTxt]; }