require('dotenv').config(); const { Client, Collection, Intents } = require('discord.js'); const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_WEBHOOKS, Intents.FLAGS.GUILD_MESSAGE_REACTIONS], allowedMentions: { parse: ['users', 'roles'], repliedUser: true } }); client.guild = new Collection(); client.commands = new Collection(); client.parties = new Collection(); client.aliases = new Map(); client.categories = new Map(); client.categoryAliases = new Map(); client.limits = new Map(); client.startup = (new Date()).getTime(); client.state = null; (async () => { const commandsLoader = await require('./handlers/commands')(client); const eventsLoader = await require('./handlers/events')(client); const categoriesLoader = await require('./handlers/categories')(client); if (commandsLoader && eventsLoader && categoriesLoader) { console.log('--- LOGGING IN ---'); client.login(process.env.TOKEN).then(() => { console.log("--- LOGGED IN ---"); }) } else { return console.log('--- FAILED TO LOAD HANDLERS ---'); } })()