-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
49 lines (39 loc) · 1.42 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
38
39
40
41
42
43
44
45
46
47
48
49
const { Client, Collection } = require("discord.js");
require('dotenv').config();
const client = new Client({
intents: 32767,
});
module.exports = client;
// Global Variables
client.commands = new Collection();
client.slashCommands = new Collection();
client.aliases = new Collection();
client.token = process.env.DISCORD_TOKEN;
client.prefix = process.env.PREFIX;
// ANTI CRASH MECH!
// =====================================================
process.on("unhandledRejection", (reason, p) => {
console.log(" [antiCrash] :: Unhandled Rejection/Catch");
console.log(reason, p);
});
process.on("uncaughtException", (err, origin) => {
console.log(" [antiCrash] :: Uncaught Exception/Catch");
console.log(err, origin);
});
process.on("uncaughtExceptionMonitor", (err, origin) => {
console.log(" [antiCrash] :: Uncaught Exception/Catch (MONITOR)");
console.log(err, origin);
});
process.on("multipleResolves", (type, promise, reason) => {
console.log(" [antiCrash] :: Multiple Resolves");
console.log(type, promise, reason);
});
// =====================================================
// Initializing the project
// =====================================================
require("./handler")(client);
// =====================================================
// Bot Login
// =====================================================
client.login(client.token);
// =====================================================