This repository has been archived on 2024-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
discord.js-rr-bot/bot.js
2022-06-18 23:28:38 -04:00

39 lines
No EOL
1.4 KiB
JavaScript

(async () => {
const Discord = require("discord.js");
const config = require("./Config");
const path = __dirname;
const react = require("./Src/Functions/mongodb-reaction-role/index");
const client = new Discord.Client({
intents: 32767,
partials: ["MESSAGE", "CHANNEL", "GUILD_MEMBER", "REACTION", "MESSAGE", "USER"]
});
exports.client = client;
exports.path = path;
exports.config = config;
client.commands = {};
client.events = new Discord.Collection();
client.commands.messageCommands = new Discord.Collection();
client.commands.messageCommands.aliases = new Discord.Collection();
client.commands.contextMenus = new Discord.Collection();
client.commands.slashCommands = new Discord.Collection();
client.commands.buttonCommands = new Discord.Collection();
client.commands.selectMenus = new Discord.Collection();
// The maps of the reactions. uh idk what to call it
client.react = new Map(); // do not rename here something, or else ded // save all msg id, role id
client.fetchforguild = new Map()
// end of that shit
const Handler = require(`${path}/Src/Structures/Handlers/Handler`);
await Handler.loadMessageCommands(client, path);
await Handler.loadEvents(client);
await client.login(config.token);
await Handler.loadSlashCommands(client, path);
await Handler.loadContextMenus(client, path);
await Handler.loadButtonCommands(client, path);
await Handler.loadSelectMenus(client, path);
react.setURL(config.mongo);
})()