-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.js
51 lines (44 loc) · 1.46 KB
/
bot.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const discord = require('discord.js');
const client = new discord.Client({
disableEveryone: true
});
const { readdir } = require('fs');
const config = require('./config/config.json');
require('dotenv').config();
const DBL = require('dblapi.js');
const dbl = new DBL(process.env.DBL, client);
client.commands = new discord.Collection();
client.aliases = new discord.Collection();
client.timeout = new discord.Collection();
client.colors = config.colors;
client.emotes = config.emotes;
client.queue = new Map();
client.dbl = dbl
readdir('./events/', async (err, files) => {
if(err) console.log(err.stack)
files.forEach(async file => {
if(!file.endsWith(".js")) return;
const events = require(`./events/${file}`)(client);
});
});
readdir('./handlers/', async (err, files) => {
if(err) console.log(err.stack)
files.forEach(file => {
if(!file.endsWith(".js")) return;
const handlers = require(`./handlers/${file}`)(client);
});
});
readdir('./database/', async (err, files) => {
if(err) return console.log(err.stack);
files.forEach(file => {
if(!file.endsWith(".js")) return;
const database = require(`./database/${file}`)(client);
});
});
readdir('./DBL/', async (err, files) => {
if(err) return console.log(err.stack);
files.forEach(file => {
if(!file.endsWith(".js")) return;
const DBL = require(`./DBL/${file}`)(dbl);
});
});