fix alias and add swtiching playing game

This commit is contained in:
MSFTserver 2018-02-16 00:57:24 -08:00 committed by GitHub
parent a7e72723d5
commit a5f04cbb26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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];
}