ModalBuilder
export declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCallbackData>
export declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCallbackData>
A builder that creates API-compatible JSON data for modals.
Implements
JSONEncodable<APIModalInteractionResponseCallbackData>constructor({ components, ...data }?)
Creates a new modal from API data.
Name | Type | Optional | Description |
---|---|---|---|
{ components, ...data } | Partial<APIModalInteractionResponseCallbackData> | Yes | None |
Readonly
The components within this modal.
Readonly
data
:
Partial<APIModalInteractionResponseCallbackData>
The API data associated with this modal.
addComponents(components)
:
this
Adds components to this modal.
Name | Type | Optional | Description |
---|---|---|---|
components | RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIModalActionRowComponent>> | No | The components to add |
setComponents(components)
:
this
Sets components for this modal.
Name | Type | Optional | Description |
---|---|---|---|
components | RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder>> | No | The components to set |
setCustomId(customId)
:
this
Sets the custom id of this modal.
Name | Type | Optional | Description |
---|---|---|---|
customId | string | No | The custom id to use |
setTitle(title)
:
this
Sets the title of this modal.
Name | Type | Optional | Description |
---|---|---|---|
title | string | No | The title to use |
toJSON()
:
APIModalInteractionResponseCallbackData
Serializes this builder to API-compatible JSON data.