From 183ade24249f78e48fccdca08167bd3a02862184 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Fri, 4 Sep 2026 13:40:25 +0100 Subject: [PATCH] fix(applicationCommands): allow `X-Discord-Locale` (#11616) fix(applicationCommands): allow locale header --- packages/core/src/api/applicationCommands.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/core/src/api/applicationCommands.ts b/packages/core/src/api/applicationCommands.ts index cceedc959..5c39e40cd 100644 --- a/packages/core/src/api/applicationCommands.ts +++ b/packages/core/src/api/applicationCommands.ts @@ -3,6 +3,7 @@ import { makeURLSearchParams, type RequestData, type REST } from '@discordjs/rest'; import { Routes, + type Locale, type RESTGetAPIApplicationCommandPermissionsResult, type RESTGetAPIApplicationCommandResult, type RESTGetAPIApplicationCommandsQuery, @@ -42,10 +43,11 @@ export class ApplicationCommandsAPI { public async getGlobalCommands( applicationId: Snowflake, query: RESTGetAPIApplicationCommandsQuery = {}, - { auth, signal }: Pick = {}, + { auth, locale, signal }: Pick & { locale?: Locale } = {}, ) { return this.rest.get(Routes.applicationCommands(applicationId), { auth, + headers: locale ? { 'X-Discord-Locale': locale } : {}, query: makeURLSearchParams(query), signal, }) as Promise; @@ -161,10 +163,11 @@ export class ApplicationCommandsAPI { applicationId: Snowflake, guildId: Snowflake, query: RESTGetAPIApplicationGuildCommandsQuery = {}, - { auth, signal }: Pick = {}, + { auth, locale, signal }: Pick & { locale?: Locale } = {}, ) { return this.rest.get(Routes.applicationGuildCommands(applicationId, guildId), { auth, + headers: locale ? { 'X-Discord-Locale': locale } : {}, query: makeURLSearchParams(query), signal, }) as Promise;