ModalComponents

Create a formatted Modal Components Object

Constructor

new ModalComponents() → {ModalComponents}

Returns:
Type: 
ModalComponents
Example
const textInput = interaction.components.getValueById("test"); // returns the field value
const textInputTwo = interaction.components.getDataById("testTwo"); // returns the field as object

Members

components :Array.<object>|array

the interaction components data

Type:
  • Array.<object> | array

Methods

getComponents() → {Array.<object>}

Get the interaction components

Returns:
Type: 
Array.<object>

getDataById(id) → {object}

Get a field by id

Parameters:
NameTypeDescription
idstring
Returns:
Type: 
object
Example
const textInput = interaction.components.getDataById("textInput"); // returns the field as object

getValueById(id) → {string}

Get the interaction components value

Parameters:
NameTypeDescription
idstring
Returns:
Type: 
string
Example
const textInput = interaction.components.getValueById("textInput"); // returns the field value