class ModalBuilder

external
declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCallbackData>

A builder that creates API-compatible JSON data for modals.

Constructors

Creates a new modal from API data.

readonlyexternal
components : readonly ActionRowBuilder[]

The components within this modal.

external
addActionRows() : this

Adds action rows to this modal.

external
setActionRows() : this

Sets the action rows for this modal.

external
setCustomId(
customId: string
) : this

Sets the custom id of this modal.

external
setTitle(
title: string
) : this

Sets the title of this modal.

external
spliceActionRows() : this

Removes, replaces, or inserts action rows for this modal.

Examples:Remove the first action row:
embed.spliceActionRows(0, 1);
Remove the first n action rows:
const n = 4;
embed.spliceActionRows(0, n);
Remove the last action row:
embed.spliceActionRows(-1, 1);

external
toJSON(
validationOverride?: boolean
) : APIModalInteractionResponseCallbackData

Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.