Updated server intents

This commit is contained in:
Logan Cusano
2023-06-03 15:38:40 -04:00
parent 0280cb5384
commit 7fbaf31335

View File

@@ -26,7 +26,7 @@ const {
} = require('discord.js'); } = require('discord.js');
const client = new Client({ const client = new Client({
intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.Guilds] intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.Guilds, GatewayIntentBits.GuildPresences, GatewayIntentBits.GuildMembers]
}); });
prefix = process.env.PREFIX 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')); //const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) { for (const file of commandFiles) {
const filePath = path.join(commandsPath, file); const filePath = path.join(commandsPath, file);
const command = require(filePath); const command = require(filePath);
log.DEBUG("Importing command: ", command.data.name); if (command.data instanceof Promise) {
// Set a new item in the Collection command.data.then(async (builder) => {
// With the key as the command name and the value as the exported module command.data = builder;
client.commands.set(command.data.name, command); 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 // Run when the bot is ready
@@ -137,7 +148,7 @@ client.on('ready', () => {
runHTTPServer(); runHTTPServer();
log.DEBUG("Starting Node Monitoring Service"); log.DEBUG("Starting Node Monitoring Service");
runNodeMonitorService(); //runNodeMonitorService();
log.DEBUG("Starting RSS watcher"); log.DEBUG("Starting RSS watcher");
runRssService(); runRssService();