Added some things

This commit is contained in:
ahoZiorce
2018-07-01 16:16:53 +02:00
parent 979d9043be
commit 8dd3ad81ae
8 changed files with 572 additions and 3 deletions

View File

@@ -1 +1,32 @@
console.log('Initial commit');
const Eris = require('eris');
const configM = require('./src/configManager');
const logger = require('./src/logger');
if (!configM.loadConfig('./config.json')) {
logger.error('No config file has been found in the directory, please configure the template that has been created.');
}
logger.log('Config loaded');
var bot = new Eris(configM.config.token);
bot.on('ready', () => {
logger.log(bot.user.username + '#' + bot.user.discriminator);
bot.editStatus('online', {
name: configM.config.game,
});
logger.log('Game has been set to ' + configM.config.game);
logger.log('Done !');
});
bot.on("messageCreate", (msg) => {
if(msg.content === "!ping") {
bot.createMessage(msg.channel.id, "Pong!");
}
});
bot.connect();
process.on('SIGINT', function() {
bot.disconnect();
logger.log('Disconnected');
process.exit();
});