Skip to content

Commit 7196fe3

Browse files
Jiralitekyranet
andauthoredMay 12, 2023
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>
1 parent 5351ab4 commit 7196fe3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎packages/discord.js/src/structures/AutocompleteInteraction.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ class AutocompleteInteraction extends BaseInteraction {
8686
await this.client.rest.post(Routes.interactionCallback(this.id, this.token), {
8787
body: {
8888
type: InteractionResponseType.ApplicationCommandAutocompleteResult,
89-
data: { choices: this.client.options.jsonTransformer(options) },
89+
data: {
90+
choices: options.map(({ nameLocalizations, ...option }) => ({
91+
...this.client.options.jsonTransformer(option),
92+
name_localizations: nameLocalizations,
93+
})),
94+
},
9095
},
9196
auth: false,
9297
});

0 commit comments

Comments
 (0)
Please sign in to comment.