Added some things
This commit is contained in:
33
index.js
33
index.js
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user