Skip to content

Significant Delay in Slash Command Registration for Guild-Specific Commands #2270

@InvixGG

Description

@InvixGG

Summary

Slash command registration experiences a significant delay (up to 30 seconds or longer) after the bot has fully started when registering guild-specific commands. This was not an issue in previous versions of the library.

What version of the library are you using?

v5.0.0-nightly (make sure you are using the latest nightly!)

What .NET version are you using? Make sure to use the latest patch release for your major version.

.NET 9.0

Operating System

Windows 11

Reproduction Steps

  1. Configure DSharpPlus with the CommandsExtension.

  2. Register slash commands as guild-specific. This can be done by:

    • Using DebugGuildId in CommandsConfiguration.
  3. Start the bot.

  4. Observe the delay between the bot reporting that it has started and the slash commands becoming available in the specified guild(s). This delay can be up to 30 seconds or longer.

Trace Logs


Exceptions or other error messages

Anything else you'd like to share

Code Sample (Registering guild-specific commands using DebugGuildId)

services.AddCommandsExtension((_, extension) =>
{
    extension.AddProcessors(new SlashCommandProcessor());
    extension.AddCommands(CommandRegistrationHelper.GetCommandTypes(Assembly.GetExecutingAssembly()));
}, new CommandsConfiguration
{
#if DEVELOPMENT
    DebugGuildId = {ID}
#endif
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    commandsFor issues related to DSharpPlus.Commands

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions