export declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCallbackData>

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

Constructors

Creates a new modal from API data.

readonly
components : readonly ActionRowBuilder[]

The components within this modal.

Adds action rows to this modal.

Sets the action rows for this modal.

setCustomId(
customId: string
) : this

Sets the custom id of this modal.

setTitle(
title: string
) : this

Sets the title of this modal.

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);

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.