mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(AutocompleteInteraction): Prevent snake casing of locales (#9565)
* fix(AutocompleteInteraction): prevent snake casing of locales * fix: avoid unnecessary overhead ops Co-authored-by: Aura Román <kyradiscord@gmail.com> --------- Co-authored-by: Aura Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user