-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
36 lines (31 loc) · 1 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
(async function () {
const { Intents } = require("discord.js");
const Bot = require("./src/classes/Bot");
const client = new Bot({
partials: ["MESSAGE", "CHANNEL"],
fetchAllMembers: false,
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.DIRECT_MESSAGES,
],
});
const mongoose = require("mongoose");
client.connection = await mongoose.connect(client.config.mongo.string, {
useNewUrlParser: true,
useUnifiedTopology: true,
});
const {
registerEvents,
registerCommands,
registerInfoCommands,
} = require("./src/functions/register");
await registerEvents(client, "../events");
await registerCommands(client, "../commands");
await registerInfoCommands(client);
client.Logger.info(`Registered ${client.commands.size} commands`, "COMMANDS");
await client.login(client.config.BOT_TOKEN);
require("./src/messageUpdateAPI.js")(client);
})();