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

feat(CommandInteraction): add support for localized slash commands #7684

Conversation

suneettipirneni
Copy link
Member

Please describe the changes this PR makes and why it should be merged:

Add support for localized names and descriptions in slash command payloads.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@ImRodry
Copy link
Contributor

ImRodry commented Mar 17, 2022

Discord API docs PR discord/discord-api-docs#4653

Copy link
Contributor

@ImRodry ImRodry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed the edit methods in ApplicationCommand (also please provide some examples in those)

@suneettipirneni suneettipirneni force-pushed the discord.js/feat/support-for-localized-slash-commands branch from 58f45e6 to 029e327 Compare March 21, 2022 18:52
packages/discord.js/typings/index.d.ts Outdated Show resolved Hide resolved
@iCrawl iCrawl added this to the discord.js v14 milestone Mar 26, 2022
Copy link

@FedorLap2006 FedorLap2006 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. However, docs state that behaviour of GET endpoints is changed, therefore they won't return name_localizations & description_localizations by default, instead they will return name_localized & description_localized, which are not included in the PR. The way this behaviour could be altered is by supplying ?with_localizations=true. Not sure what's the best solution here though.

@suneettipirneni
Copy link
Member Author

LGTM. However, docs state that behaviour of GET endpoints is changed, therefore they won't return name_localizations & description_localizations by default, instead they will return name_localized & description_localized, which are not included in the PR. The way this behaviour could be altered is by supplying ?with_localizations=true. Not sure what's the best solution here though.

I can add it as an option in the ApplicationCommandManager

@FedorLap2006
Copy link

FedorLap2006 commented Mar 26, 2022

I can add it as an option in the ApplicationCommandManager

Problem is, when it's set to false (i.e. endpoint provides localized fields) you would need to pass an additional header to alter the language. Which I'm not sure where would be the best to put a setting for

@kyranet kyranet linked an issue Mar 26, 2022 that may be closed by this pull request
@suneettipirneni suneettipirneni force-pushed the discord.js/feat/support-for-localized-slash-commands branch 3 times, most recently from fb85262 to 460d809 Compare April 3, 2022 03:20
@kyranet
Copy link
Member

kyranet commented Apr 10, 2022

There are merge conflicts, please update or rebase your branch.

@suneettipirneni suneettipirneni force-pushed the discord.js/feat/support-for-localized-slash-commands branch from 6e6ee58 to 06ea139 Compare April 10, 2022 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Slash Command localization