forked from embee/woomy
changes
This commit is contained in:
parent
9180cf1d17
commit
c570f549e5
1 changed files with 10 additions and 6 deletions
16
index.js
16
index.js
|
@ -7,15 +7,12 @@ if (Number(process.version.slice(1).split('.')[0]) < 12) {
|
|||
process.exit()
|
||||
}
|
||||
|
||||
// Load environment variables / config
|
||||
// Libraries
|
||||
const fs = require('fs')
|
||||
const colors = require('colors')
|
||||
const Discord = require('discord.js')
|
||||
const client = new Discord.Client({ disabledEvents: ['TYPING_START'] })
|
||||
|
||||
// Load functions module
|
||||
require('./modules/functions')(client)
|
||||
|
||||
// Logger
|
||||
client.logger = require('tracer').colorConsole({
|
||||
format: [
|
||||
|
@ -52,6 +49,9 @@ if (fs.existsSync('./config.js') === false) {
|
|||
require('dotenv').config()
|
||||
client.config = require('./config')
|
||||
|
||||
// Load functions module
|
||||
require('./modules/functions')(client)
|
||||
|
||||
// Command/alias cache
|
||||
client.commands = new Discord.Collection()
|
||||
client.cooldown = new Discord.Collection()
|
||||
|
@ -62,7 +62,9 @@ const init = async () => {
|
|||
// Load events
|
||||
fs.readdir('./events', (err, files) => {
|
||||
if (err) {
|
||||
client.logger.error('Failed to get files in events directory! ' + err);
|
||||
client.logger.fatal('Failed to get files in events directory! ' + err);
|
||||
|
||||
process.exit();
|
||||
|
||||
return;
|
||||
};
|
||||
|
@ -80,7 +82,9 @@ const init = async () => {
|
|||
// Load commands
|
||||
fs.readdir('./commands', (err, files) => {
|
||||
if (err) {
|
||||
client.logger.error('Failed to get files in commands directory! ' + err);
|
||||
client.logger.fatal('Failed to get files in commands directory! ' + err);
|
||||
|
||||
process.exit();
|
||||
|
||||
return;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue