obama-bot/index.js

25 lines
733 B
JavaScript
Raw Normal View History

2020-11-28 16:38:23 +00:00
require('dotenv').config(); // Require and run dotenv
// Import modules
2020-07-17 16:08:27 +00:00
const Discord = require('discord.js');
const Enmap = require('enmap');
2020-11-28 16:38:23 +00:00
const client = new Discord.Client({partials: ["REACTION", "MESSAGE"]});
2020-07-17 16:08:27 +00:00
2020-11-28 16:38:23 +00:00
// Use log75 for logging
const { default: Log75, LogLevel } = require('log75')
const logger = new Log75(process.env.NODE_ENV == 'production' ? LogLevel.Standard : LogLevel.Debug, true);
2020-07-17 16:08:27 +00:00
2020-11-28 16:38:23 +00:00
module.exports = {
client: client,
logger: logger
2020-07-17 16:08:27 +00:00
}
2020-11-28 16:38:23 +00:00
// Execute modules in util folder in order
async function runModules() {
for (const file of ['commandLoader', 'login', 'eventHandler', 'karma']) {
logger.debug(`Running module ${file}`);
await require(`./util/${file}`).run();
2020-07-17 16:08:27 +00:00
}
2020-11-28 16:38:23 +00:00
}
runModules();