TextInput

Create a text input

Constructor

new TextInput()

Example
const { TextInput } = require("interactions.js");

const textInput = new TextInput()
   .setCustomId("test")
   .setPlaceholder("test")
   .setStyle(TextInputStyles.Short)
   .setLabel("test");

Methods

setCustomId(customId) → {TextInput}

set the custom id for the text input

Parameters:
NameTypeDescription
customIdstring
Returns:
Type: 
TextInput

setLabel(label) → {TextInput}

Parameters:
NameTypeDescription
labelstring
Returns:
Type: 
TextInput

setMaxLength(maxLength) → {TextInput}

set the max length of the text input

Parameters:
NameTypeDescription
maxLengthnumber
Returns:
Type: 
TextInput

setMinLength(minLength) → {TextInput}

set the min length of the text input

Parameters:
NameTypeDescription
minLengthnumber
Returns:
Type: 
TextInput

setPlaceholder(placeholder) → {TextInput}

set the placeholder of the text input

Parameters:
NameTypeDescription
placeholderstring
Returns:
Type: 
TextInput

setRequired(required) → {TextInput}

set the text input as required

Parameters:
NameTypeDescription
requiredboolean
Returns:
Type: 
TextInput

setStyle(style) → {TextInput}

set the style of the text input

Parameters:
NameTypeDescription
stylenumber
Returns:
Type: 
TextInput

setValue(value) → {TextInput}

set the value of the text input

Parameters:
NameTypeDescription
valuestring
Returns:
Type: 
TextInput