-
Notifications
You must be signed in to change notification settings - Fork 31
/
index.js
47 lines (42 loc) · 1.39 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
require('dotenv').config();
const { GatewayIntentBits, Partials, Options } = require('discord.js');
const Kato = require('./handler/clientBuilder');
const client = new Kato({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.GuildVoiceStates,
],
partials: [
Partials.Message,
Partials.Channel,
Partials.GuildMember,
Partials.Reaction,
Partials.User,
Partials.ThreadMember
],
makeCache: Options.cacheEverything()
});
require('discord-logs')(client);
require('./handler/module')(client);
require('./handler/event')(client);
client.login(process.env.DISCORD_TOKEN);
process.on("unhandledRejection", (reason, promise) => {
console.error("Unhandled Rejection at:", reason.stack || reason);
});
process.on("uncaughtException", err => {
console.error(new Date());
console.error(`Caught exception: ${err}`);
console.error(err.stack);
if (err.code == "PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR") {
console.error("true");
}
});