Hello, I was not really sure whether I should post this in #discordjs-support or #sapphire-support, but since it's an issue regarding subcommand registration, I decided to post it here!
I'm kinda new to all of this and I just made a new bot. I wanted to create a
2024-09-20 17:40:06 - ERROR - ApplicationCommandRegistry[channels] Failed to register application command with name "channels" DiscordAPIError[50035]: Invalid Form Body
2024-09-20 17:40:06 - ERROR - ApplicationCommandRegistry[channels] Failed to register application command with name "channels" DiscordAPIError[50035]: Invalid Form Body
How can I fix it?
Solution
I just replaced the
new SlashCommandBuilder()
new SlashCommandBuilder()
with
(builder) => builder
(builder) => builder
and now it works!
// Pretty much like this:export class ChannelsCommand extends Subcommand { public override registerApplicationCommands(registry: ChatInputCommand.Registry) { registry.registerChatInputCommand((builder) => builder .setName(this.name) .setDescription(this.description) // ...
// Pretty much like this:export class ChannelsCommand extends Subcommand { public override registerApplicationCommands(registry: ChatInputCommand.Registry) { registry.registerChatInputCommand((builder) => builder .setName(this.name) .setDescription(this.description) // ...