ui changes

This commit is contained in:
2025-10-03 08:39:32 -04:00
parent 1341b325ee
commit 9bc7a5e6b8
18 changed files with 629 additions and 419 deletions

View File

@@ -1,25 +1,26 @@
require('dotenv').config({ path: '../backend/.env' });
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { REST, Routes } = require('discord.js');
const commands = [{
name: 'ping',
description: 'Replies with Pong!',
}];
const rest = new REST({ version: '9' }).setToken(process.env.DISCORD_BOT_TOKEN);
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_BOT_TOKEN);
(async () => {
const deployCommands = async (guildId) => {
try {
console.log('Started refreshing application (/) commands.');
console.log(`Started refreshing application (/) commands for guild ${guildId}.`);
await rest.put(
Routes.applicationGuildCommands(process.env.DISCORD_CLIENT_ID, process.env.GUILD_ID),
Routes.applicationGuildCommands(process.env.DISCORD_CLIENT_ID, guildId),
{ body: commands },
);
console.log('Successfully reloaded application (/) commands.');
console.log(`Successfully reloaded application (/) commands for guild ${guildId}.`);
} catch (error) {
console.error(error);
}
})();
};
module.exports = deployCommands;