Frog
Frog
DIAdiscord.js - Imagine an app
Created by Frog on 5/10/2024 in #djs-questions
Having discord API errors when refreshing commands
Using 14.14.1 of discord.js I have my commands in a separate folder and when discord tries to get the "name" and "description" of the command it errors out and doesn't update Error here: DiscordAPIError[50035]: Invalid Form Body 8.description[BASE_TYPE_REQUIRED]: This field is required at handleErrors (C:\Users\point\OneDrive\Desktop\Catbot V2\node_modules@discordjs\rest\dist\index.js:722:13) at process.processTicksAndRejections (c:\Users\point\OneDrive\Desktop\Catbot V2\lib\internal\process\task_queues.js:95:5) at async SequentialHandler.runRequest (C:\Users\point\OneDrive\Desktop\Catbot V2\node_modules@discordjs\rest\dist\index.js:1120:23) at async SequentialHandler.queueRequest (C:\Users\point\OneDrive\Desktop\Catbot V2\node_modules@discordjs\rest\dist\index.js:953:14) at async _REST.request (C:\Users\point\OneDrive\Desktop\Catbot V2\node_modules@discordjs\rest\dist\index.js:1266:22) at async refreshCommands (C:\Users\point\OneDrive\Desktop\Catbot V2\catbotv2.js:41:5) {requestBody: {…}, rawError: {…}, code: 50035, status: 400, method: 'PUT', …} Here is one of my code snippets for the structure
module.exports = {
name: "ping",
description: "Sends a ping request to the bot",
async execute(interaction, client) {
const ping = Math.round(client.ws.ping);
const embed = {
color: 0x009ff,
title: "Ping",
description: `Pong! Bot Latency is ${ping}ms.`,
};
await interaction.reply({ embeds: [embed], ephemeral: false });
},
};
console.log("Ping Responding/Alive");
module.exports = {
name: "ping",
description: "Sends a ping request to the bot",
async execute(interaction, client) {
const ping = Math.round(client.ws.ping);
const embed = {
color: 0x009ff,
title: "Ping",
description: `Pong! Bot Latency is ${ping}ms.`,
};
await interaction.reply({ embeds: [embed], ephemeral: false });
},
};
console.log("Ping Responding/Alive");
10 replies