Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect "description_localizations" key's value build in CommandOptionBuilder #571

Merged
merged 1 commit into from
Oct 22, 2023
Merged

fix: incorrect "description_localizations" key's value build in CommandOptionBuilder #571

merged 1 commit into from
Oct 22, 2023

Conversation

priyanuj-gogoi
Copy link
Contributor

@priyanuj-gogoi priyanuj-gogoi commented Oct 22, 2023

Description

Fixes a bug with slash command localization (particularly in sub-commands).

When both localization name & description are set, the localization description uses the value of localization name which leads the slash command to have same localization name & description values.

Example

final command = ChatGroup(
  'name',
  '.',
  localizedNames: { Locale.hi: 'नेम' },
  children: [
    ChatCommand(
      'sub_name',
      'sub_description',
      localizedNames: { Locale.hi: 'सब_नेम' },
      localizedDescriptions: { Locale.hi: 'सब_डिस्क्रिप्शन' },
      id('sub_name', (ChatContext ctx) async {
        await ctx.respond(MessageBuilder(content: 'Meow!'));
      })
    )
  ]
);
Preview output

Screenshot_20231022_215048

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • Ran dart analyze or make analyze and fixed all issues
  • Ran dart format --set-exit-if-changed -l 160 ./lib or make format and fixed all issues
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@priyanuj-gogoi priyanuj-gogoi changed the title fix: incorrect "description_localizations" key's value build for CommandOptionBuilder fix: incorrect "description_localizations" key's value build in CommandOptionBuilder Oct 22, 2023
@abitofevrything abitofevrything self-assigned this Oct 22, 2023
@abitofevrything abitofevrything added the bug Something isn't working label Oct 22, 2023
@abitofevrything abitofevrything added this to the 6.0.1 milestone Oct 22, 2023
@abitofevrything abitofevrything merged commit 9728833 into nyxx-discord:dev Oct 22, 2023
3 checks passed
@abitofevrything
Copy link
Member

Thanks!

@priyanuj-gogoi priyanuj-gogoi deleted the fix/localization-description branch October 22, 2023 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants