Issue
Whenever trying to create a command using the newly inbuilt SlashCommandBuilder of Discord.JS v14, I get an error stating:
DiscordAPIError[50035]: Invalid Form Body
description[BASE_TYPE_REQUIRED]: This field is required
name[APPLICATION_COMMAND_INVALID_NAME]: Command name is invalid
at SequentialHandler.runRequest (D:\Discord.JS Command Handler\node_modules\@discordjs\rest\src\lib\handlers\SequentialHandler.ts:479:11)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (D:\Discord.JS Command Handler\node_modules\@discordjs\rest\src\lib\handlers\SequentialHandler.ts:204:11)
at async REST.request (D:\Discord.JS Command Handler\node_modules\@discordjs\rest\src\lib\REST.ts:341:20)
at async ApplicationCommandManager.set (D:\Discord.JS Command Handler\node_modules\discord.js\src\managers\ApplicationCommandManager.js:173:18) {
rawError: {
code: 50035,
errors: { description: [Object], name: [Object] },
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/1001050663310073948/commands',
requestBody: { files: undefined, json: [ [Object] ] }
}
I am using TypeScript, and my command code is:
import {
CommandInteraction,
PermissionFlagsBits,
SlashCommandBuilder,
} from "discord.js";
module.exports = {
data: new SlashCommandBuilder()
.setName(`ping`)
.setDescription(`Pong!`)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
execute(interaction: CommandInteraction): void {
interaction.reply({ content: `Pong!`, ephemeral: true });
},
};
I've tried everything I can think of, but nothing wants to work
Solution
Found the issue, there was an issue elsewhere in another file that was interfering with this one, whoops ._.
Answered By - Nyan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.