Skip to content

Commit

Permalink
feat: add separate guild/dm interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx committed Feb 11, 2022
1 parent e117561 commit a34b3ec
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 4 deletions.
18 changes: 17 additions & 1 deletion deno/payloads/v8/_interactions/modalSubmit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import type { APIActionRowComponent, APIModalComponent } from '../channel.ts';
import type { APIBaseInteraction, InteractionType, ComponentType } from '../mod.ts';
import type {
APIBaseInteraction,
InteractionType,
ComponentType,
APIDMInteractionWrapper,
APIGuildInteractionWrapper,
} from '../mod.ts';

export interface ModalSubmitComponent {
type: ComponentType;
Expand Down Expand Up @@ -27,3 +33,13 @@ export interface APIModalSubmission {
*/
export type APIModalSubmitInteraction = APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission> &
Required<Pick<APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission>, 'data'>>;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIModalSubmitDMInteraction = APIDMInteractionWrapper<APIModalSubmitInteraction>;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIModalSubmitGuildInteraction = APIGuildInteractionWrapper<APIModalSubmitInteraction>;
18 changes: 17 additions & 1 deletion deno/payloads/v9/_interactions/modalSubmit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import type { APIActionRowComponent, APIModalComponent } from '../channel.ts';
import type { APIBaseInteraction, InteractionType, ComponentType } from '../mod.ts';
import type {
APIBaseInteraction,
InteractionType,
ComponentType,
APIDMInteractionWrapper,
APIGuildInteractionWrapper,
} from '../mod.ts';

export interface ModalSubmitComponent {
type: ComponentType;
Expand Down Expand Up @@ -27,3 +33,13 @@ export interface APIModalSubmission {
*/
export type APIModalSubmitInteraction = APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission> &
Required<Pick<APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission>, 'data'>>;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIModalSubmitDMInteraction = APIDMInteractionWrapper<APIModalSubmitInteraction>;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIModalSubmitGuildInteraction = APIGuildInteractionWrapper<APIModalSubmitInteraction>;
18 changes: 17 additions & 1 deletion payloads/v8/_interactions/modalSubmit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import type { APIActionRowComponent, APIModalComponent } from '../channel';
import type { APIBaseInteraction, InteractionType, ComponentType } from '../index';
import type {
APIBaseInteraction,
InteractionType,
ComponentType,
APIDMInteractionWrapper,
APIGuildInteractionWrapper,
} from '../index';

export interface ModalSubmitComponent {
type: ComponentType;
Expand Down Expand Up @@ -27,3 +33,13 @@ export interface APIModalSubmission {
*/
export type APIModalSubmitInteraction = APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission> &
Required<Pick<APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission>, 'data'>>;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIModalSubmitDMInteraction = APIDMInteractionWrapper<APIModalSubmitInteraction>;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIModalSubmitGuildInteraction = APIGuildInteractionWrapper<APIModalSubmitInteraction>;
18 changes: 17 additions & 1 deletion payloads/v9/_interactions/modalSubmit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import type { APIActionRowComponent, APIModalComponent } from '../channel';
import type { APIBaseInteraction, InteractionType, ComponentType } from '../index';
import type {
APIBaseInteraction,
InteractionType,
ComponentType,
APIDMInteractionWrapper,
APIGuildInteractionWrapper,
} from '../index';

export interface ModalSubmitComponent {
type: ComponentType;
Expand Down Expand Up @@ -27,3 +33,13 @@ export interface APIModalSubmission {
*/
export type APIModalSubmitInteraction = APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission> &
Required<Pick<APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission>, 'data'>>;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIModalSubmitDMInteraction = APIDMInteractionWrapper<APIModalSubmitInteraction>;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIModalSubmitGuildInteraction = APIGuildInteractionWrapper<APIModalSubmitInteraction>;

0 comments on commit a34b3ec

Please sign in to comment.