Skip to content

Commit

Permalink
fix(AutocompleteInteraction): Prevent snake casing of locales (#9565)
Browse files Browse the repository at this point in the history
* fix(AutocompleteInteraction): prevent snake casing of locales

* fix: avoid unnecessary overhead ops

Co-authored-by: Aura Román <[email protected]>

---------

Co-authored-by: Aura Román <[email protected]>
  • Loading branch information
Jiralite and kyranet authored May 12, 2023
1 parent 5351ab4 commit 7196fe3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ class AutocompleteInteraction extends BaseInteraction {
await this.client.rest.post(Routes.interactionCallback(this.id, this.token), {
body: {
type: InteractionResponseType.ApplicationCommandAutocompleteResult,
data: { choices: this.client.options.jsonTransformer(options) },
data: {
choices: options.map(({ nameLocalizations, ...option }) => ({
...this.client.options.jsonTransformer(option),
name_localizations: nameLocalizations,
})),
},
},
auth: false,
});
Expand Down

0 comments on commit 7196fe3

Please sign in to comment.