mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-21 10:50:08 +00:00
feat: More label components and text display in modals (#1351)
This commit is contained in:
32
deno/payloads/v10/_interactions/modalSubmit.ts
generated
32
deno/payloads/v10/_interactions/modalSubmit.ts
generated
@@ -3,6 +3,7 @@ import type {
|
||||
APIBaseInteraction,
|
||||
APIDMInteractionWrapper,
|
||||
APIGuildInteractionWrapper,
|
||||
APIInteractionDataResolved,
|
||||
ComponentType,
|
||||
InteractionType,
|
||||
} from '../mod.ts';
|
||||
@@ -20,7 +21,30 @@ export interface APIModalSubmitStringSelectComponent extends APIBaseModalSubmitC
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent = APIModalSubmitStringSelectComponent | APIModalSubmitTextInputComponent;
|
||||
export interface APIModalSubmitUserSelectComponent extends APIBaseModalSubmitComponent<ComponentType.UserSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitRoleSelectComponent extends APIBaseModalSubmitComponent<ComponentType.RoleSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitMentionableSelectComponent
|
||||
extends APIBaseModalSubmitComponent<ComponentType.MentionableSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitChannelSelectComponent extends APIBaseModalSubmitComponent<ComponentType.ChannelSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent =
|
||||
| APIModalSubmitChannelSelectComponent
|
||||
| APIModalSubmitMentionableSelectComponent
|
||||
| APIModalSubmitRoleSelectComponent
|
||||
| APIModalSubmitStringSelectComponent
|
||||
| APIModalSubmitTextInputComponent
|
||||
| APIModalSubmitUserSelectComponent;
|
||||
|
||||
export interface ModalSubmitActionRowComponent extends APIBaseComponent<ComponentType.ActionRow> {
|
||||
components: APIModalSubmitTextInputComponent[];
|
||||
@@ -36,6 +60,12 @@ export type APIModalSubmissionComponent = ModalSubmitActionRowComponent | ModalS
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure}
|
||||
*/
|
||||
export interface APIModalSubmission {
|
||||
/**
|
||||
* Data for users, members, channels, and roles in the modal's auto-populated select menus
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure}
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A developer-defined identifier for the component, max 100 characters
|
||||
*/
|
||||
|
||||
10
deno/payloads/v10/_interactions/responses.ts
generated
10
deno/payloads/v10/_interactions/responses.ts
generated
@@ -1,5 +1,10 @@
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v10.ts';
|
||||
import type { APIActionRowComponent, APIComponentInModalActionRow, APILabelComponent } from '../channel.ts';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIComponentInModalActionRow,
|
||||
APILabelComponent,
|
||||
APITextDisplayComponent,
|
||||
} from '../channel.ts';
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
|
||||
|
||||
/**
|
||||
@@ -128,7 +133,8 @@ export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
|
||||
export type APIModalInteractionResponseCallbackComponent =
|
||||
| APIActionRowComponent<APIComponentInModalActionRow>
|
||||
| APILabelComponent;
|
||||
| APILabelComponent
|
||||
| APITextDisplayComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal}
|
||||
|
||||
12
deno/payloads/v10/channel.ts
generated
12
deno/payloads/v10/channel.ts
generated
@@ -1898,6 +1898,12 @@ export interface APIBaseSelectMenuComponent<
|
||||
* @defaultValue `false`
|
||||
*/
|
||||
disabled?: boolean;
|
||||
/**
|
||||
* Whether the component is required to answer in a modal.
|
||||
*
|
||||
* @defaultValue `true`
|
||||
*/
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1931,10 +1937,6 @@ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<Com
|
||||
* Specified choices in a select menu; max 25
|
||||
*/
|
||||
options: APISelectMenuOption[];
|
||||
/**
|
||||
* Whether this component is required in modals.
|
||||
*/
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2457,7 +2459,7 @@ export type APIComponentInModalActionRow = APITextInputComponent;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#label-label-child-components}
|
||||
*/
|
||||
export type APIComponentInLabel = APIStringSelectComponent | APITextInputComponent;
|
||||
export type APIComponentInLabel = APISelectMenuComponent | APITextInputComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#section}
|
||||
|
||||
32
deno/payloads/v9/_interactions/modalSubmit.ts
generated
32
deno/payloads/v9/_interactions/modalSubmit.ts
generated
@@ -3,6 +3,7 @@ import type {
|
||||
APIBaseInteraction,
|
||||
APIDMInteractionWrapper,
|
||||
APIGuildInteractionWrapper,
|
||||
APIInteractionDataResolved,
|
||||
ComponentType,
|
||||
InteractionType,
|
||||
} from '../mod.ts';
|
||||
@@ -20,7 +21,30 @@ export interface APIModalSubmitStringSelectComponent extends APIBaseModalSubmitC
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent = APIModalSubmitStringSelectComponent | APIModalSubmitTextInputComponent;
|
||||
export interface APIModalSubmitUserSelectComponent extends APIBaseModalSubmitComponent<ComponentType.UserSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitRoleSelectComponent extends APIBaseModalSubmitComponent<ComponentType.RoleSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitMentionableSelectComponent
|
||||
extends APIBaseModalSubmitComponent<ComponentType.MentionableSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitChannelSelectComponent extends APIBaseModalSubmitComponent<ComponentType.ChannelSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent =
|
||||
| APIModalSubmitChannelSelectComponent
|
||||
| APIModalSubmitMentionableSelectComponent
|
||||
| APIModalSubmitRoleSelectComponent
|
||||
| APIModalSubmitStringSelectComponent
|
||||
| APIModalSubmitTextInputComponent
|
||||
| APIModalSubmitUserSelectComponent;
|
||||
|
||||
export interface ModalSubmitActionRowComponent extends APIBaseComponent<ComponentType.ActionRow> {
|
||||
components: APIModalSubmitTextInputComponent[];
|
||||
@@ -36,6 +60,12 @@ export type APIModalSubmissionComponent = ModalSubmitActionRowComponent | ModalS
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure}
|
||||
*/
|
||||
export interface APIModalSubmission {
|
||||
/**
|
||||
* Data for users, members, channels, and roles in the modal's auto-populated select menus
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure}
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A developer-defined identifier for the component, max 100 characters
|
||||
*/
|
||||
|
||||
10
deno/payloads/v9/_interactions/responses.ts
generated
10
deno/payloads/v9/_interactions/responses.ts
generated
@@ -1,5 +1,10 @@
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v9.ts';
|
||||
import type { APIActionRowComponent, APIComponentInModalActionRow, APILabelComponent } from '../channel.ts';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIComponentInModalActionRow,
|
||||
APILabelComponent,
|
||||
APITextDisplayComponent,
|
||||
} from '../channel.ts';
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
|
||||
|
||||
/**
|
||||
@@ -128,7 +133,8 @@ export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
|
||||
export type APIModalInteractionResponseCallbackComponent =
|
||||
| APIActionRowComponent<APIComponentInModalActionRow>
|
||||
| APILabelComponent;
|
||||
| APILabelComponent
|
||||
| APITextDisplayComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal}
|
||||
|
||||
12
deno/payloads/v9/channel.ts
generated
12
deno/payloads/v9/channel.ts
generated
@@ -1897,6 +1897,12 @@ export interface APIBaseSelectMenuComponent<
|
||||
* @defaultValue `false`
|
||||
*/
|
||||
disabled?: boolean;
|
||||
/**
|
||||
* Whether the component is required to answer in a modal.
|
||||
*
|
||||
* @defaultValue `true`
|
||||
*/
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1930,10 +1936,6 @@ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<Com
|
||||
* Specified choices in a select menu; max 25
|
||||
*/
|
||||
options: APISelectMenuOption[];
|
||||
/**
|
||||
* Whether this component is required in modals.
|
||||
*/
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2456,7 +2458,7 @@ export type APIComponentInModalActionRow = APITextInputComponent;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#label-label-child-components}
|
||||
*/
|
||||
export type APIComponentInLabel = APIStringSelectComponent | APITextInputComponent;
|
||||
export type APIComponentInLabel = APISelectMenuComponent | APITextInputComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#section}
|
||||
|
||||
@@ -3,6 +3,7 @@ import type {
|
||||
APIBaseInteraction,
|
||||
APIDMInteractionWrapper,
|
||||
APIGuildInteractionWrapper,
|
||||
APIInteractionDataResolved,
|
||||
ComponentType,
|
||||
InteractionType,
|
||||
} from '../index';
|
||||
@@ -20,7 +21,30 @@ export interface APIModalSubmitStringSelectComponent extends APIBaseModalSubmitC
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent = APIModalSubmitStringSelectComponent | APIModalSubmitTextInputComponent;
|
||||
export interface APIModalSubmitUserSelectComponent extends APIBaseModalSubmitComponent<ComponentType.UserSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitRoleSelectComponent extends APIBaseModalSubmitComponent<ComponentType.RoleSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitMentionableSelectComponent
|
||||
extends APIBaseModalSubmitComponent<ComponentType.MentionableSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitChannelSelectComponent extends APIBaseModalSubmitComponent<ComponentType.ChannelSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent =
|
||||
| APIModalSubmitChannelSelectComponent
|
||||
| APIModalSubmitMentionableSelectComponent
|
||||
| APIModalSubmitRoleSelectComponent
|
||||
| APIModalSubmitStringSelectComponent
|
||||
| APIModalSubmitTextInputComponent
|
||||
| APIModalSubmitUserSelectComponent;
|
||||
|
||||
export interface ModalSubmitActionRowComponent extends APIBaseComponent<ComponentType.ActionRow> {
|
||||
components: APIModalSubmitTextInputComponent[];
|
||||
@@ -36,6 +60,12 @@ export type APIModalSubmissionComponent = ModalSubmitActionRowComponent | ModalS
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure}
|
||||
*/
|
||||
export interface APIModalSubmission {
|
||||
/**
|
||||
* Data for users, members, channels, and roles in the modal's auto-populated select menus
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure}
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A developer-defined identifier for the component, max 100 characters
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v10';
|
||||
import type { APIActionRowComponent, APIComponentInModalActionRow, APILabelComponent } from '../channel';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIComponentInModalActionRow,
|
||||
APILabelComponent,
|
||||
APITextDisplayComponent,
|
||||
} from '../channel';
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands';
|
||||
|
||||
/**
|
||||
@@ -128,7 +133,8 @@ export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
|
||||
export type APIModalInteractionResponseCallbackComponent =
|
||||
| APIActionRowComponent<APIComponentInModalActionRow>
|
||||
| APILabelComponent;
|
||||
| APILabelComponent
|
||||
| APITextDisplayComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal}
|
||||
|
||||
@@ -1898,6 +1898,12 @@ export interface APIBaseSelectMenuComponent<
|
||||
* @defaultValue `false`
|
||||
*/
|
||||
disabled?: boolean;
|
||||
/**
|
||||
* Whether the component is required to answer in a modal.
|
||||
*
|
||||
* @defaultValue `true`
|
||||
*/
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1931,10 +1937,6 @@ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<Com
|
||||
* Specified choices in a select menu; max 25
|
||||
*/
|
||||
options: APISelectMenuOption[];
|
||||
/**
|
||||
* Whether this component is required in modals.
|
||||
*/
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2457,7 +2459,7 @@ export type APIComponentInModalActionRow = APITextInputComponent;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#label-label-child-components}
|
||||
*/
|
||||
export type APIComponentInLabel = APIStringSelectComponent | APITextInputComponent;
|
||||
export type APIComponentInLabel = APISelectMenuComponent | APITextInputComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#section}
|
||||
|
||||
@@ -3,6 +3,7 @@ import type {
|
||||
APIBaseInteraction,
|
||||
APIDMInteractionWrapper,
|
||||
APIGuildInteractionWrapper,
|
||||
APIInteractionDataResolved,
|
||||
ComponentType,
|
||||
InteractionType,
|
||||
} from '../index';
|
||||
@@ -20,7 +21,30 @@ export interface APIModalSubmitStringSelectComponent extends APIBaseModalSubmitC
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent = APIModalSubmitStringSelectComponent | APIModalSubmitTextInputComponent;
|
||||
export interface APIModalSubmitUserSelectComponent extends APIBaseModalSubmitComponent<ComponentType.UserSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitRoleSelectComponent extends APIBaseModalSubmitComponent<ComponentType.RoleSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitMentionableSelectComponent
|
||||
extends APIBaseModalSubmitComponent<ComponentType.MentionableSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitChannelSelectComponent extends APIBaseModalSubmitComponent<ComponentType.ChannelSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent =
|
||||
| APIModalSubmitChannelSelectComponent
|
||||
| APIModalSubmitMentionableSelectComponent
|
||||
| APIModalSubmitRoleSelectComponent
|
||||
| APIModalSubmitStringSelectComponent
|
||||
| APIModalSubmitTextInputComponent
|
||||
| APIModalSubmitUserSelectComponent;
|
||||
|
||||
export interface ModalSubmitActionRowComponent extends APIBaseComponent<ComponentType.ActionRow> {
|
||||
components: APIModalSubmitTextInputComponent[];
|
||||
@@ -36,6 +60,12 @@ export type APIModalSubmissionComponent = ModalSubmitActionRowComponent | ModalS
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure}
|
||||
*/
|
||||
export interface APIModalSubmission {
|
||||
/**
|
||||
* Data for users, members, channels, and roles in the modal's auto-populated select menus
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure}
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A developer-defined identifier for the component, max 100 characters
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v9';
|
||||
import type { APIActionRowComponent, APIComponentInModalActionRow, APILabelComponent } from '../channel';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIComponentInModalActionRow,
|
||||
APILabelComponent,
|
||||
APITextDisplayComponent,
|
||||
} from '../channel';
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands';
|
||||
|
||||
/**
|
||||
@@ -128,7 +133,8 @@ export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
|
||||
export type APIModalInteractionResponseCallbackComponent =
|
||||
| APIActionRowComponent<APIComponentInModalActionRow>
|
||||
| APILabelComponent;
|
||||
| APILabelComponent
|
||||
| APITextDisplayComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal}
|
||||
|
||||
@@ -1897,6 +1897,12 @@ export interface APIBaseSelectMenuComponent<
|
||||
* @defaultValue `false`
|
||||
*/
|
||||
disabled?: boolean;
|
||||
/**
|
||||
* Whether the component is required to answer in a modal.
|
||||
*
|
||||
* @defaultValue `true`
|
||||
*/
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1930,10 +1936,6 @@ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<Com
|
||||
* Specified choices in a select menu; max 25
|
||||
*/
|
||||
options: APISelectMenuOption[];
|
||||
/**
|
||||
* Whether this component is required in modals.
|
||||
*/
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2456,7 +2458,7 @@ export type APIComponentInModalActionRow = APITextInputComponent;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#label-label-child-components}
|
||||
*/
|
||||
export type APIComponentInLabel = APIStringSelectComponent | APITextInputComponent;
|
||||
export type APIComponentInLabel = APISelectMenuComponent | APITextInputComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#section}
|
||||
|
||||
Reference in New Issue
Block a user