-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
56 lines (48 loc) · 1.56 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
const { Client, Collection, Partials, GatewayIntentBits} = require("discord.js");
const config = require("./config.json");
const handler = require("./handler/index");
const process = require("node:process");
const myIntents = [
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
];
const myPartials = [
Partials.Channel,
Partials.Message,
Partials.Reaction
];
const client = new Client({
partials: myPartials,
intents: myIntents
});
const Discord = require("discord.js");
module.exports = client;
client.discord = Discord;
client.commands = new Collection();
client.slash = new Collection();
client.config = require("./config");
// Carregar comando, eventos e DataBase
handler.loadEvents(client);
handler.loadSlashCommands(client);
handler.loadDateBase(config.mongoUrl);
// Erro no Handling
process.on("uncaughtException", (err) => {
console.log("Uncaught Exception: " + err);
});
process.on("unhandledRejection", (reason, promise) => {
console.log("[GRAVE] Rejeição possivelmente não tratada em: Promise ", promise, " motivo: ", reason.message);
});
client.login(config.token);