-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.js
More file actions
42 lines (36 loc) · 1013 Bytes
/
Copy pathbot.js
File metadata and controls
42 lines (36 loc) · 1013 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require("dotenv").config();
const {
Client,
GatewayIntentBits,
Collection,
Partials,
} = require("discord.js");
const client = new Client({
partials: [Partials.Channel, Partials.Message, Partials.GuildMember],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessageReactions,
],
});
client.commands = new Collection();
client.buttons = new Collection();
client.selectMenus = new Collection();
client.modals = new Collection();
client.slashCommands = new Collection();
client.cooldowns = new Collection();
["commandHandler.js", "interactionHandler.js", "eventHandler.js"].forEach(
(handler) => {
require(`./handlers/${handler}`)(client);
}
);
process.on("unhandledRejection", (error) => {
console.error("Unhandled promise rejection:", error);
});
client.login(process.env.BOT_TOKEN);
module.exports = {
client,
};