#How many slash commands can be registered?

1 messages · Page 1 of 1 (latest)

mild sage
#

Currently I have 10 slash commands in a class and I get the following error:

   at DSharpPlus.Net.DiscordApiClient.BulkOverwriteGlobalApplicationCommandsAsync(UInt64 application_id, IEnumerable`1 commands)
   at DSharpPlus.SlashCommands.SlashCommandsExtension.<>c__DisplayClass39_0.<<RegisterCommands>b__0>d.MoveNext()```

If I comment out a few commands it works again

Any idea what the problem could be?
solemn leafBOT
#
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.

mild sage
#

Okay found following: {"code": 50035, "errors": {"_errors": [{"code": "APPLICATION_COMMAND_TOO_LARGE", "message": "Command exceeds maximum size (4000)"}]}, "message": "Invalid Form Body"}

grim wagon
#

hans tag where code

mild sage
grim wagon
#

that should be catched by the libary

quasi cipher
#

Though, you could technically have upward of 200,000 if you're creative with subcommands

mild sage
#

I only have 10 Slash Commands like these

[SlashCommand("tribeplayerlist", "Prints a list of every player of a specified tribe with both PlayerID and SteamID")]
public async Task GetTribeIdPlayerListCommand(InteractionContext ctx, 
[Option("TribeID", "TeamID or TribeID")] long TribeID,
[ChoiceProvider(typeof(RconServerChoiceProvider))]
[Option("Server", "Select the target server")] string rconserver)
{
......
}```
#

All work if I comment out 3 commands (no matter which one)

mild sage
#

Okay I think I figured it out, the [ChoiceProvider(typeof(RconServerChoiceProvider))] is present in every command with 13 options each. If I reduce the options to 2 it works again.

Sooo how can i fix it and have 13 options and have 11 slash commands?

quasi cipher
#

It's moreso that everything must come up to less than 6000 characters or something like that

#

So all names, descriptions, etc