#slash commands bad request 400 error

1 messages · Page 1 of 1 (latest)

slim crater
#

when i try to register my slash command class, this error pops up:

DSharpPlus.Exceptions.BadRequestException: Bad request: 400
   at DSharpPlus.Net.DiscordApiClient.BulkOverwriteGlobalApplicationCommandsAsync(UInt64 application_id, IEnumerable`1 commands)
   at DSharpPlus.SlashCommands.SlashCommandsExtension.<>c__DisplayClass39_0.<<RegisterCommands>b__0>d.MoveNext()```
is this a user error or a genuine library bug?
stray spadeBOT
#

Hello, I'm an automated bot to help people with common issues. Here's a list of stuff that I think are related to your problem.

Automated suggestion: How to find a solution to a `BadRequestException`

It's true that the BadRequestException doesn't provide that much information to the console. To get more info about what you did wrong, catch the BadRequestException yourself, and check the .JsonMessage and the .Errors properties.

hybrid ruin
#

likely not a library bug, just that your command definition isn't valid for registration. (though it'd be nice to get some more specific information.) you can probably narrow down which commands cause it by commenting them out. maybe also check the discord docs on application commands since the limits are well defined (https://discord.com/developers/docs/interactions/application-commands)

slim crater
#

found the issue

#

i had two slash commands with the same name thinking i can make multiple variants

#

is there a valid way to do that?