-
-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathindex.js
More file actions
28 lines (20 loc) · 764 Bytes
/
Copy pathindex.js
File metadata and controls
28 lines (20 loc) · 764 Bytes
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
require('dotenv').config();
const { Client, Collection } = require('discord.js');
const fs = require('fs');
const { BOT_TOKEN, PREFIX } = process.env;
const client = new Client({ disableEveryone: true });
client.commands = new Collection();
client.aliases = new Collection();
client.prefix = PREFIX;
client.categories = fs.readdirSync('./commands/');
['command', 'event'].forEach((handler) => {
require(`./handlers/${handler}`)(client);
});
client.on('guildMemberAdd', async (member) => {
await require('./events/guild/memberAdd')(member);
});
client.on('guildMemberRemove', async (message) => {
await require('./events/guild/memberRemove')(message);
});
client.login(BOT_TOKEN)
.then(() => console.log('[BOT INFO] - Bot has successfully logged in'));