-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.js
37 lines (34 loc) · 1.11 KB
/
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const { Client, MessageEmbed, Intents, Collection } = require('discord.js');
const { token } = require('./config.json')
const { loadEvents } = require("./handler/loadEvents")
const { loadSlashCommands } = require("./handler/loadSlashCommands")
const { checkValid } = require("./exports/checkValid")
const client = new Client({
partials: ['MESSAGE', 'CHANNEL', 'REACTION' ],
allowedMentions: { parse: ["users", "roles"] },
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.GUILD_WEBHOOKS,
Intents.FLAGS.GUILD_INVITES,
Intents.FLAGS.GUILD_PRESENCES,
],
});
client.slash = new Collection()
loadEvents(client);
loadSlashCommands(client);
checkValid();
process.on("uncaughtException", (err) => {
console.log("Uncaught Exception: " + err);
});
process.on("unhandledRejection", (reason, promise) => {
console.log(
"[FATAL] Possibly Unhandled Rejection at: Promise ",
promise,
" reason: ",
reason.message
);
});
client.login(token);