-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.ts
54 lines (50 loc) · 1.53 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { Client, Collection, Partials, GatewayIntentBits } from 'discord.js';
const client: any = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessageTyping,
GatewayIntentBits.MessageContent
],
partials: [
Partials.Message,
Partials.Channel,
Partials.GuildMember,
Partials.Reaction,
Partials.GuildScheduledEvent,
Partials.User,
Partials.ThreadMember
],
shards: "auto",
});
module.exports = client;
client.commands = new Collection();
client.events = new Collection();
client.slashCommands = new Collection();
['Commands', 'Events', 'SlashCommands'].forEach(handler => {
require(`./handlers/${handler}`)(client);
})
//nodejs-events
process.on("unhandledRejection", e => {
console.log(e)
})
process.on("uncaughtException", e => {
console.log(e)
})
process.on("uncaughtExceptionMonitor", e => {
console.log(e)
})
client.login(process.env.token).catch((err) => {
console.log(err.message)
})