Modal
classe · Source
Represents a modal (form) to be shown in response to an interaction
Constructor
Parameters
| Name | Type | Description |
|---|---|---|
data | Object | Modal to clone or raw data |
client | Client | The client constructing this Modal, if provided Default: null. |
Properties
components
A list of MessageActionRows in the modal Source
customId
A unique string to be sent in the interaction when submitted Source
title
The title to be displayed on this modal Source
nonce
Timestamp (Discord epoch) of when this modal was created Source
id
ID slash / button / menu when modal is displayed Source
applicationId
Application sending the modal Source
channelId
The id of the channel the message was sent in Source
replied
Whether this interaction has already been replied to Source
guildId
The id of the guild the message was sent in, if any Source
channel
The channel that the message was sent in Source
guild
The guild the message was sent in (if in a guild channel) Source
isMessage
Check data Source
Methods
reply
Reply to this modal with data. (Event only) Returns: Promise<(Message\|Modal)>
client.on('interactionModalCreate', modal => {
// Modal > ActionRow > TextInput
modal.components[0].components[0].setValue('1+1');
modal.components[1].components[0].setValue('hello');
modal.reply();
})