From 7fbaf313359468a4c5b79069eca0bb555b7dc4bf Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sat, 3 Jun 2023 15:38:40 -0400 Subject: [PATCH] Updated server intents --- Server/index.js | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Server/index.js b/Server/index.js index 69c5cd0..ba5622b 100644 --- a/Server/index.js +++ b/Server/index.js @@ -26,7 +26,7 @@ const { } = require('discord.js'); const client = new Client({ - intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.Guilds] + intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.Guilds, GatewayIntentBits.GuildPresences, GatewayIntentBits.GuildMembers] }); prefix = process.env.PREFIX @@ -117,11 +117,22 @@ const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith(' //const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); for (const file of commandFiles) { const filePath = path.join(commandsPath, file); - const command = require(filePath); - log.DEBUG("Importing command: ", command.data.name); - // Set a new item in the Collection - // With the key as the command name and the value as the exported module - client.commands.set(command.data.name, command); + const command = require(filePath); + if (command.data instanceof Promise) { + command.data.then(async (builder) => { + command.data = builder; + log.DEBUG("Importing command: ", command.data.name, command); + // Set a new item in the Collection + // With the key as the command name and the value as the exported module + client.commands.set(command.data.name, command); + }); + } + else { + log.DEBUG("Importing command: ", command.data.name, command); + // Set a new item in the Collection + // With the key as the command name and the value as the exported module + client.commands.set(command.data.name, command); + } } // Run when the bot is ready @@ -137,7 +148,7 @@ client.on('ready', () => { runHTTPServer(); log.DEBUG("Starting Node Monitoring Service"); - runNodeMonitorService(); + //runNodeMonitorService(); log.DEBUG("Starting RSS watcher"); runRssService();