Add join command to server #7 #15

Merged
logan merged 14 commits from Add-join-command-to-server-#7 into master 2023-06-03 23:05:41 -04:00
Showing only changes of commit 7fbaf31335 - Show all commits

View File

@@ -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();