-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.ts
36 lines (32 loc) · 911 Bytes
/
Index.ts
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
import "dotenv/config";
import { Client, Constants } from "oceanic.js";
import DiscordEvents from "./manager/DiscordEvents";
const Bot = new Client({
auth: `Bot ${process.env.DISCORD_TOKEN}`,
gateway: {
compress: false,
intents: Constants.Intents.GUILD_VOICE_STATES | Constants.Intents.GUILDS
},
collectionLimits: {
auditLogEntries: 0,
autoModerationRules: 0,
stickers: 0,
stageInstances: 0,
invites: 0,
emojis: 0,
groupChannels: 0,
guildThreads: 0,
integrations: 0,
privateChannels: 0,
scheduledEvents: 0,
messages: 5 // message is not really necessary here
}
});
// add discord events listener early
DiscordEvents(Bot);
// connect the bot
Bot.connect();
// handle errors
process
.on('unhandledRejection', error => console.error('unhandledRejection \n', error))
.on('uncaughtException', error => console.log('uncaughtException \n', error));