-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.js
More file actions
34 lines (25 loc) · 805 Bytes
/
bot.js
File metadata and controls
34 lines (25 loc) · 805 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
28
29
30
31
32
33
34
require("dotenv").config();
require("module-alias/register");
require("@helpers/extenders/Message");
require("@helpers/extenders/Guild");
require("@helpers/extenders/GuildChannel");
const { BotClient } = require("@src/structures");
const { initializeMongoose } = require("@src/database/mongoose");
const { validateConfiguration } = require("@helpers/Validator");
validateConfiguration();
const client = new BotClient();
client.loadCommands("src/commands");
client.loadContexts("src/contexts");
client.loadEvents("src/events");
// get error
process.on("uncaughtException", (err) => {
console.error(err);
});
// get promise error
process.on("unhandledRejection", (err) => {
console.error(err);
});
(async () => {
await initializeMongoose();
await client.login(process.env.BOT_TOKEN);
})();