class ModalBuilder
implements
JSONEncodable<APIModalInteractionResponseCallbackData>export declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCallbackData>A builder that creates API-compatible JSON data for modals.
readonlycomponents : readonly (ActionRowBuilder | AnyModalComponentBuilder)[]
The components within this modal.
addLabelComponents(...components: RestOrArray<APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder)>) : this
...components: RestOrArray<APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder)>
Adds label components to this modal.
addTextDisplayComponents(...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>) : this
...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>
Adds text display components to this modal.
setCustomId(customId: string) : this
customId: string
Sets the custom id of this modal.
setTitle(title: string) : this
title: string
Sets the title of this modal.
Removes, replaces, or inserts components for this modal.
Examples:Remove the first component:Remove the first n components:Remove the last component:
modal.spliceComponents(0, 1);const n = 4;
modal.spliceComponents(0, n);modal.spliceComponents(-1, 1); toJSON(validationOverride?: boolean) : APIModalInteractionResponseCallbackData
validationOverride?: boolean
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.