-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (26 loc) · 861 Bytes
/
index.js
File metadata and controls
27 lines (26 loc) · 861 Bytes
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
const { Client, Collection } = require('discord.js');
const client = new Client({ intents: ["GUILDS"] });
require("dotenv").config();
const discordModals = require('discord-modals');
const { Database } = require("quickmongo");
//==============================================
client.db = new Database(process.env.MONGO);
client.commands = new Collection();
discordModals(client);
["events", "commands"]
.filter(Boolean)
.forEach(h => {
require(`./handlers/${h}`)(client);
});
process.on("uncaughtException", (err) => {
console.log(err.message)
})
process.on("unhandledRejection", (err) => {
console.log(err.message)
})
client.once("ready", async () => {
const data = await client.commands.map(cmds => { return [cmds.data.name, cmds.data.description] });
client.data = data;
require("./web/index")(client)
});
client.login(process.env.TOKEN)