Search...

ModalBuilder

export declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCallbackData> 
export declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCallbackData> 

No summary provided.

Implements

JSONEncodable<APIModalInteractionResponseCallbackData>

constructor({ components, ...data }?)

Constructs a new instance of the ModalBuilder class
NameTypeOptionalDescription
{ components, ...data }Partial<APIModalInteractionResponseCallbackData>YesNone
Readonly

data

:

Partial<APIModalInteractionResponseCallbackData>

addComponents(components)

:

this

Adds components to this modal
NameTypeOptionalDescription
componentsRestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIModalActionRowComponent>>NoThe components to add to this modal

setComponents(components)

:

this

Sets the components in this modal
NameTypeOptionalDescription
componentsRestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder>>NoThe components to set this modal to

setCustomId(customId)

:

this

Sets the custom id of the modal
NameTypeOptionalDescription
customIdstringNoThe custom id of this modal

setTitle(title)

:

this

Sets the title of the modal
NameTypeOptionalDescription
titlestringNoThe title of the modal

toJSON()

:

APIModalInteractionResponseCallbackData

Serializes this component to an API-compatible JSON object
Remarks
This method runs validations on the data before serializing it. As such, it may throw an error if the data is invalid.