Update EnumConverter and ApplicationCommandOption to register localizations (#2651)

This commit is contained in:
Florian Pabst
2023-04-02 22:03:05 +02:00
committed by GitHub
parent a8ae1e9b9f
commit 75ae48830e
2 changed files with 6 additions and 2 deletions

View File

@@ -93,7 +93,8 @@ namespace Discord.API
Choices = option.Choices?.Select(x => new ApplicationCommandOptionChoice
{
Name = x.Name,
Value = x.Value
Value = x.Value,
NameLocalizations = x.NameLocalizations?.ToDictionary() ?? Optional<Dictionary<string, string>>.Unspecified,
}).ToArray() ?? Optional<ApplicationCommandOptionChoice[]>.Unspecified;
Options = option.Options?.Select(x => new ApplicationCommandOption(x)).ToArray() ?? Optional<ApplicationCommandOption[]>.Unspecified;