-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
34 lines (28 loc) · 1.01 KB
/
index.js
File metadata and controls
34 lines (28 loc) · 1.01 KB
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
const { Client, GatewayIntentBits, Collection } = require('discord.js');
const handler = require("./handler/index");
const config = require('./botconfig.json')
const Discord = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessageTyping,
],
});
module.exports = client;
client.discord = Discord;
client.commands = new Collection();
client.slash = new Collection();
handler.loadEvents(client);
handler.loadSlashCommands(client);
process.on("uncaughtException", (err) => {
console.log("Uncaught Exception: " + err);
});
process.on("unhandledRejection", (reason, promise) => {
console.log("[Фаталити] Possibly Unhandled Rejection at: Promise ", promise, " reason: ", reason.message);
});
client.login(config.token);