-
Notifications
You must be signed in to change notification settings - Fork 0
/
baylee.js
47 lines (39 loc) · 1.95 KB
/
baylee.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
/*
/ $$$$$$$$ /$$
| $$__ $$ | $$
| $$ \ $$ /$$$$$$ /$$ /$$| $$ /$$$$$$ /$$$$$$
| $$$$$$$ |____ $$| $$ | $$| $$ /$$__ $$ /$$__ $$
| $$__ $$ /$$$$$$$| $$ | $$| $$| $$$$$$$$| $$$$$$$$
| $$ \ $$ /$$__ $$| $$ | $$| $$| $$_____/| $$_____/
| $$$$$$$/| $$$$$$$| $$$$$$$| $$| $$$$$$$| $$$$$$$
|_______/ \_______/ \____ $$|__/ \_______/ \_______/
| $$$ |
| $$$$$$ /
\______/
*/
const Discord = require('discord.js');
const info = require('./package');
const client = new Discord.Client({ partials: ['MESSAGE', 'CHANNEL', 'REACTION'] });
const errorHandler = require('./handlers/error');
const classesHandler = require('./handlers/classes');
const listenerHandler = require('./handlers/listeners');
const eventsHandler = require('./handlers/events');
client.on('disconnect', () => errorHandler.disconnect())
.on('reconnecting', () => errorHandler.reconnecting())
.on('warn', err => errorHandler.warn(err))
.on('error', err => errorHandler.error(err))
.on('DiscordAPIError', err => errorHandler.DiscordAPIError(err))
.on('uncaughtException', err => errorHandler.unhandledRejection(err))
.on('unhandledRejection', err => errorHandler.unhandledRejection(err));
client.on('ready', async () => {
console.log(`==================\nBaylee.lol v${info.version}\n==================`);
const handlers = {
classes: await classesHandler.getClasses(client),
listeners: await listenerHandler.getListeners(client)
}
await eventsHandler.getEvents(client, handlers);
client.user.setActivity(`bae help | baylee.lol`, { type: 'WATCHING' });
console.log(`#> Loading finished`);
console.log(`#> Logged in as ${client.user.tag}`);
});
client.login(process.env.BOT_TOKEN);