-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathvortex.js
30 lines (26 loc) · 1.04 KB
/
vortex.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const { Client, Collection } = require('discord.js');
const client = (global.client = new Client({ fetchAllMembers: true }));
const { readdirSync } = require('fs');
require('./src/configs/settings.js')(client);
require('./src/handlers/functions.js')(client);
const { Token } = client.settings;
// Collections
client.commands = new Collection();
client.cooldowns = new Collection();
// Handlers
require('./src/handlers/mongoHandler.js');
require('./src/handlers/eventHandler.js');
// Checking Commands
readdirSync('./src/commands').filter(dir => {
const commandFiles = readdirSync(`./src/commands/${dir}/`).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./src/commands/${dir}/${file}`);
client.commands.set(command.name, command);
// console.log(`[COMMAND] ${command.name} Loaded!`);
}
});
// Connecting To Client
client.login(Token).then(() => console.log('[BOT] Connection Started')).catch(() => {
console.log('[BOT] Failed To Start Connection, Trying Again');
process.exit();
});