This repository has been archived by the owner on Nov 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
/
bot.js
executable file
·51 lines (46 loc) · 2.1 KB
/
bot.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
import { Client, GatewayIntentBits, Partials } from "discord.js";
import { BOT_TOKEN } from "./src/config.js";
import { dirname } from "node:path";
import { ButtonManager } from "./src/structures/managers/buttonCommands.js";
import { EventManager } from "./src/structures/managers/events.js";
import { MessageCMDManager } from "./src/structures/managers/messageCommands.js";
import { ModalManager } from "./src/structures/managers/modalForms.js";
import { SelectMenuManager } from "./src/structures/managers/selectMenus.js";
import { SlashManager } from "./src/structures/managers/slashCommands.js";
import JSONdb from "simple-json-db";
const __dirname = dirname(import.meta.url);
export const rootPath = __dirname;
(async () => {
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.MessageContent, // Only for bots with message content intent access.
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildInvites,
],
partials: [Partials.Channel]
});
client.cooldownDB = new JSONdb("./cooldownDB.json");
client.messageCommands = new Map();
client.messageCommands_Aliases = new Map();
client.events = new Map();
client.buttonCommands = new Map();
client.selectMenus = new Map();
client.modalForms = new Map();
client.contextMenus = new Map();
client.slashCommands = new Map();
await MessageCMDManager(client, __dirname);
await EventManager(client, __dirname);
await ButtonManager(client, __dirname);
await SelectMenuManager(client, __dirname);
await ModalManager(client, __dirname);
await client.login(BOT_TOKEN);
await SlashManager(client, __dirname); // Includes context menu handling as they belong to same command type.
})();