Skip to content

Localization not working with UserCommands and MessageCommands #2267

@9True

Description

@9True

Summary

The localization feature is not working with UserCommands and MessageCommands processors. Tested without the localizer, the commands work. The localizer work with any other SlashCommands, so it seems that both UserCommands and MessageCommands does not implement the localization feature.

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

No response

Reproduction Steps

  1. Create a UserCommand and MessageCommand without localization, they work.
  2. Add the InteractionLocalizer attribute with a working implementation of a localizer to them: The commands no longer work and both spit a NRE.

Trace Logs


Exceptions or other error messages

System.NullReferenceException: Object reference not set to an instance of an object.
   at DSharpPlus.Commands.Processors.SlashCommands.SlashCommandProcessor.ExecuteLocalizerAsync(Type localizer, String name)
   at DSharpPlus.Commands.Processors.UserCommands.UserCommandProcessor.ToApplicationCommandAsync(Command command)
   at DSharpPlus.Commands.Processors.UserCommands.UserCommandProcessor.ConfigureAsync(CommandsExtension extension)
   at DSharpPlus.Commands.CommandsExtension.RefreshAsync()
   at DSharpPlus.Commands.RefreshEventHandler.HandleEventAsync(DiscordClient sender, ClientStartedEventArgs eventArgs)
   at DSharpPlus.Clients.DefaultEventDispatcher.<>c__DisplayClass6_0`1.<<DispatchAsync>b__0>d.MoveNext()

Anything else you'd like to share

No response

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