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