Made a lot of things

This commit is contained in:
ahoZiorce
2018-07-02 17:44:37 +02:00
parent 6ecb727ff3
commit 4caefcdfd7
9 changed files with 436 additions and 28 deletions

View File

@@ -1,7 +1,6 @@
const configM = require('./src/configManager');
const logger = require('./src/logger');
const commandH = require('./src/commandHandler');
// TODO: botClient.js
if (!configM.loadConfig('./config.json')) {
logger.error('No config file has been found in the directory, please configure the template that has been created.');
@@ -11,7 +10,10 @@ logger.log('Config loaded');
const bot = require('./src/botClient').bot;
require('./src/commandLoader').load();
logger.log('Commands loaded');
logger.log('Modules loaded');
require('./src/dbEventInterface');
logger.log('Database Loaded');
bot.on('ready', () => {
logger.log(bot.user.username + '#' + bot.user.discriminator);
@@ -27,6 +29,7 @@ bot.on("messageCreate", (msg) => {
if (content === msg.content) return;
if (msg.author.bot) return;
if (msg.author === bot.user) return;
if (msg.channel.type !== 0) return;
let trimmedContent = content.trim();
commandH.apply(trimmedContent, msg);
});