From 56abb5c0e1b2926a53c3d6fa07323fdaeb45893c Mon Sep 17 00:00:00 2001 From: Taken Date: Mon, 1 May 2023 23:44:26 +0200 Subject: [PATCH] Fixing command deployment --- deploy-commands.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deploy-commands.js b/deploy-commands.js index a79f479..150283c 100644 --- a/deploy-commands.js +++ b/deploy-commands.js @@ -2,6 +2,7 @@ const { REST, Routes } = require('discord.js'); const env = require('dotenv').config(); const token = process.env.TOKEN; const clientId = process.env.CLIENTID; +const guildId = process.env.GUILDID; const fs = require('node:fs'); const args = process.argv.slice(2); const arg = args[0]; @@ -51,11 +52,11 @@ else if (arg === '--prod') { else if (arg === '--dev') { const commands = []; // Grab all the command files from the commands directory you created earlier - const commandFiles = fs.readdirSync('./commands-contextmenu').filter(file => file.endsWith('.js')); + const commandFiles = fs.readdirSync('./commands-testing').filter(file => file.endsWith('.js')); // Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment for (const file of commandFiles) { - const command = require(`./commands-contextmenu/${file}`); + const command = require(`./commands-testing/${file}`); commands.push(command.data.toJSON()); } @@ -70,7 +71,7 @@ else if (arg === '--dev') { // The put method is used to fully refresh all commands in the guild with the current set const data = await rest.put( - Routes.applicationCommands(clientId), + Routes.applicationGuildCommands(clientId, guildId), { body: commands }, );