class ModalBuilder
implements
JSONEncodable<APIModalInteractionResponseCallbackData>export declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCallbackData>
A builder that creates API-compatible JSON data for modals.
readonlyreadonly ActionRowBuilder[] components :
The components within this modal.
addActionRows...components: RestOrArray<ActionRowBuilder | APIActionRowComponent<APIModalActionRowComponent> | ((builder: ActionRowBuilder) => ActionRowBuilder)>) : this (
...components: RestOrArray<ActionRowBuilder | APIActionRowComponent<APIModalActionRowComponent> | ((builder: ActionRowBuilder) => ActionRowBuilder)>
Adds action rows to this modal.
setActionRows...components: RestOrArray<ActionRowBuilder | APIActionRowComponent<APIModalActionRowComponent> | ((builder: ActionRowBuilder) => ActionRowBuilder)>) : this (
...components: RestOrArray<ActionRowBuilder | APIActionRowComponent<APIModalActionRowComponent> | ((builder: ActionRowBuilder) => ActionRowBuilder)>
Sets the action rows for this modal.
setCustomIdcustomId: string) : this (
customId: string
Sets the custom id of this modal.
setTitletitle: string) : this (
title: string
Sets the title of this modal.
spliceActionRowsindex: numberdeleteCount: number...rows: (ActionRowBuilder | APIActionRowComponent<APIModalActionRowComponent> | ((builder: ActionRowBuilder) => ActionRowBuilder))[]) : this (
index: number
deleteCount: number
...rows: (ActionRowBuilder | APIActionRowComponent<APIModalActionRowComponent> | ((builder: ActionRowBuilder) => ActionRowBuilder))[]
Removes, replaces, or inserts action rows for this modal.
Examples:Remove the first action row:Remove the first n action rows:Remove the last action row:
embed.spliceActionRows(0, 1);
const n = 4;
embed.spliceActionRows(0, n);
embed.spliceActionRows(-1, 1);
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.