diff --git a/packages/core/src/api/applicationCommands.ts b/packages/core/src/api/applicationCommands.ts index 29fde7cea..7d9fc2a2a 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,9 +43,10 @@ export class ApplicationCommandsAPI { public async getGlobalCommands( applicationId: Snowflake, query: RESTGetAPIApplicationCommandsQuery = {}, - { signal }: Pick = {}, + { locale, signal }: Pick & { locale?: Locale } = {}, ) { return this.rest.get(Routes.applicationCommands(applicationId), { + headers: locale ? { 'X-Discord-Locale': locale } : {}, query: makeURLSearchParams(query), signal, }) as Promise; @@ -156,9 +158,10 @@ export class ApplicationCommandsAPI { applicationId: Snowflake, guildId: Snowflake, query: RESTGetAPIApplicationGuildCommandsQuery = {}, - { signal }: Pick = {}, + { locale, signal }: Pick & { locale?: Locale } = {}, ) { return this.rest.get(Routes.applicationGuildCommands(applicationId, guildId), { + headers: locale ? { 'X-Discord-Locale': locale } : {}, query: makeURLSearchParams(query), signal, }) as Promise;