added welcome-leave commands and updated activitytypes
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user