added welcome-leave commands and updated activitytypes

This commit is contained in:
2025-10-03 18:00:47 -04:00
parent 9bc7a5e6b8
commit 524a6cc633
11 changed files with 258 additions and 30 deletions

View File

@@ -1,10 +1,23 @@
require('dotenv').config({ path: '../backend/.env' });
const { REST, Routes } = require('discord.js');
const fs = require('fs');
const path = require('path');
const commands = [{
name: 'ping',
description: 'Replies with Pong!',
}];
const commands = [];
const commandsPath = path.join(__dirname, 'commands');
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
if (command.enabled === false) continue;
if (command.builder) {
commands.push(command.builder.toJSON());
} else {
commands.push({ name: command.name, description: command.description });
}
}
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_BOT_TOKEN);