forked from Akira13345/Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
51 lines (42 loc) · 1.42 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
const {Client, GatewayIntentBits, Collection, Partials} = require("discord.js");
const {QuickDB} = require('quick.db');
const db = new QuickDB({filePath: 'data/db.sqlite'});
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildBans,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessageReactions
],
partials: [
Partials.GuildMember,
Partials.Message,
Partials.Channel,
Partials.User,
],
});
client.db = db;
module.exports = client;
process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at:', p, 'reason:', reason);
});
process.on('uncaughtException', (err) => {
console.log('Uncaught Exception:', err);
});
process.on('uncaughtExceptionMonitor', (err, origin) => {
console.log('Uncaught Exception Monitor:', err, origin);
});
client.commands = new Collection();
client.slashCommands = new Collection();
require('dotenv').config();
require("./handler")(client);
client.login(process.env.TOKEN);