Skip to content

Commit

Permalink
feat(APIInteraction): add locale props to interactions (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
suneettipirneni committed Jan 11, 2022
1 parent 03f12d7 commit 03b8d3f
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 4 deletions.
8 changes: 8 additions & 0 deletions deno/payloads/v8/_interactions/base.ts
Expand Up @@ -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<
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v8/_interactions/ping.ts
@@ -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'>;
8 changes: 8 additions & 0 deletions deno/payloads/v9/_interactions/base.ts
Expand Up @@ -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<
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v9/_interactions/ping.ts
@@ -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'>;
8 changes: 8 additions & 0 deletions payloads/v8/_interactions/base.ts
Expand Up @@ -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<
Expand Down
2 changes: 1 addition & 1 deletion payloads/v8/_interactions/ping.ts
@@ -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'>;
8 changes: 8 additions & 0 deletions payloads/v9/_interactions/base.ts
Expand Up @@ -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<
Expand Down
2 changes: 1 addition & 1 deletion payloads/v9/_interactions/ping.ts
@@ -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'>;

0 comments on commit 03b8d3f

Please sign in to comment.