-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
57 lines (48 loc) · 1.54 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
57
const { Client, Collection, Partials, GatewayIntentBits} = require('discord.js');
const handler = require("./handler/index");
const myIntents = [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildBans,
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');
require('dotenv').config()
module.exports = client;
client.discord = Discord;
client.commands = new Collection();
client.slash = new Collection();
client.config = require('./config')
// Carregar comando e eventos
handler.loadEvents(client);
handler.loadCommands(client);
handler.loadSlashCommands(client);
// 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(process.env.TOKEN);