forked from AhmedBonnah/DiscordBot-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.js
More file actions
52 lines (48 loc) · 2.17 KB
/
bot.js
File metadata and controls
52 lines (48 loc) · 2.17 KB
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
52
(async () => {
const { Client, GatewayIntentBits, Partials, Collection } = require("discord.js");
const { QuickDB } = require("quick.db");
const credentialManager = require("./Src/Credentials/Config");
const dirPath = __dirname;
const { messageCommandsManager, eventsManager, buttonManager, selectMenuManager, modalFormsManager, slashCommandsManager } = require("./Src/Structures/Managers/Export");
const botClient = 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]
});
exports.rootPath = dirPath;
exports.client = botClient;
exports.guildCooldownDB = new QuickDB({
filePath: `${dirPath}/guildCooldownDB.sqlite`
});
exports.globalCooldownDB = new QuickDB({
filePath: `${dirPath}/globalCooldownDB.sqlite`
});
exports.channelCooldownDB = new QuickDB({
filePath: `${dirPath}/channelCooldownDB.sqlite`
});
botClient.messageCommands = new Collection();
botClient.messageCommandsAliases = new Collection();
botClient.events = new Collection();
botClient.buttonCommands = new Collection();
botClient.selectMenus = new Collection();
botClient.modalForms = new Collection();
botClient.slashCommands = new Collection();
await messageCommandsManager(botClient, dirPath);
await eventsManager(botClient, dirPath);
await buttonManager(botClient, dirPath);
await selectMenuManager(botClient, dirPath);
await modalFormsManager(botClient, dirPath);
await botClient.login(credentialManager.botToken);
await slashCommandsManager(botClient, dirPath);
})();