feat(APIInteraction): add locale props to interactions (#273)

Reference: https://github.com/discord/discord-api-docs/pull/4265
This commit is contained in:
Suneet Tipirneni
2022-01-10 19:11:32 -05:00
committed by GitHub
parent 03f12d71ee
commit 03b8d3fee0
8 changed files with 36 additions and 4 deletions

View File

@@ -86,6 +86,14 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* For components, the message they were attached to
*/
message?: APIMessage;
/**
* The selected language of the invoking user
*/
locale: string;
/**
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: string;
}
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<

View File

@@ -1,4 +1,4 @@
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
export type APIPingInteraction = APIBaseInteraction<InteractionType.Ping, never>;
export type APIPingInteraction = Omit<APIBaseInteraction<InteractionType.Ping, never>, 'locale'>;

View File

@@ -86,6 +86,14 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* For components, the message they were attached to
*/
message?: APIMessage;
/**
* The selected language of the invoking user
*/
locale: string;
/**
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: string;
}
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<

View File

@@ -1,4 +1,4 @@
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
export type APIPingInteraction = APIBaseInteraction<InteractionType.Ping, never>;
export type APIPingInteraction = Omit<APIBaseInteraction<InteractionType.Ping, never>, 'locale'>;

View File

@@ -86,6 +86,14 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* For components, the message they were attached to
*/
message?: APIMessage;
/**
* The selected language of the invoking user
*/
locale: string;
/**
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: string;
}
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<

View File

@@ -1,4 +1,4 @@
import type { APIBaseInteraction } from './base';
import type { InteractionType } from './responses';
export type APIPingInteraction = APIBaseInteraction<InteractionType.Ping, never>;
export type APIPingInteraction = Omit<APIBaseInteraction<InteractionType.Ping, never>, 'locale'>;

View File

@@ -86,6 +86,14 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* For components, the message they were attached to
*/
message?: APIMessage;
/**
* The selected language of the invoking user
*/
locale: string;
/**
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: string;
}
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<

View File

@@ -1,4 +1,4 @@
import type { APIBaseInteraction } from './base';
import type { InteractionType } from './responses';
export type APIPingInteraction = APIBaseInteraction<InteractionType.Ping, never>;
export type APIPingInteraction = Omit<APIBaseInteraction<InteractionType.Ping, never>, 'locale'>;