-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.js
23 lines (17 loc) · 636 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const fs = require("fs");
const { Client, Intents, Collection } = require("discord.js");
const client = new Client({
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
});
client.commands = new Collection();
client.aliases = new Collection();
client.interactions = new Collection();
fs.readdir("./commands/", async (err, files) => {
const commandHandler = require("./handler/commandHandler");
await commandHandler(err, files, client);
});
fs.readdir("./events/", (err, files) => {
const eventHandler = require("./handler/eventHandler");
eventHandler(err, files, client);
});
client.login(process.env.TOKEN);