fix alias and add swtiching playing game
This commit is contained in:
parent
a7e72723d5
commit
a5f04cbb26
1 changed files with 16 additions and 2 deletions
18
bot/bot.js
18
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];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue