declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCallbackData>
A builder that creates API-compatible JSON data for modals.
readonlyexternalreadonly (ActionRowBuilder | AnyModalComponentBuilder)[] components :
The components within this modal.
external addLabelComponents...components: RestOrArray<APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder)>) : this (
...components: RestOrArray<APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder)>
Adds label components to this modal.
external addTextDisplayComponents...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>) : this (
...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>
Adds text display components to this modal.
external setCustomIdcustomId: string) : this (
customId: string
Sets the custom id of this modal.
external setTitletitle: 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);
external toJSONvalidationOverride?: 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.