-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
index.js
56 lines (47 loc) · 1.48 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
50
51
52
53
54
55
56
require('./src/console/watermark')
const { Client, Partials, Collection } = require('discord.js');
const colors = require('colors');
const config = require('./src/config/config.json')
const client = new Client({
intents: [
"Guilds",
"GuildMessages",
"GuildPresences",
"GuildMessageReactions",
"DirectMessages",
"MessageContent",
"GuildVoiceStates"
],
partials: [
Partials.Channel,
Partials.Message,
Partials.User,
Partials.GuildMember,
Partials.Reaction
]
})
if (!config.TOKEN) {
console.log("[WARN] Token for discord bot is required! put your token in config file".yellow.bold + "\n")
return process.exit();
};
client.commands = new Collection()
client.events = new Collection()
client.slash = new Collection()
client.aliases = new Collection()
client.config = require("./src/config/config.json")
module.exports = client;
["event", "slash"].forEach(file => {
require(`./src/handlers/${file}`)(client);
});
client.login(config.TOKEN)
.catch((err) => {
console.log("[CRUSH] Something went wrong while connecting to your bot" + "\n");
console.log("[CRUSH] Error from DiscordAPI :" + err);
process.exit();
})
process.on("unhandledRejection", async (err) => {
console.log(`[ANTI - CRUSH] Unhandled Rejection : ${err}`.red.bold)
})
// ©️ Copyright Project Razer LLC 2023 All Rights Reserved.
// Credits: @sandarutharuneth, @oelin
// License: MIT