Skip to content

InputText

InputText

Represents an Input Text component for a Discord interaction message.

Kind: global class

new InputText([data])

Constructs a new InputText component.

ParamTypeDescription
[data]ObjectOptional data to set for the component.
[data.custom_id]stringThe custom ID of the component.
[data.style]string | numberThe style of the component, can be a string or a number.
[data.label]stringThe label of the component.
[data.min_length]numberThe minimum length of the text input.
[data.max_length]numberThe maximum length of the text input.
[data.required]booleanWhether the component is required or not.
[data.value]stringThe value of the text input.
[data.placeholder]stringThe placeholder text for the text input.

inputText.setCustomId(customId) ⇒ InputText

Sets the custom ID of the component.

Kind: instance method of InputText
Returns: InputText - This component.

ParamTypeDescription
customIdstringThe custom ID to set.

inputText.setLabel(label) ⇒ InputText

Sets the label of the component.

Kind: instance method of InputText
Returns: InputText - This component.

ParamTypeDescription
labelstringThe label to set.

inputText.setMaxLength(maxLength) ⇒ InputText

Sets the maximum length of the text input.

Kind: instance method of InputText
Returns: InputText - This component.

ParamTypeDescription
maxLengthnumberThe maximum length to set.

inputText.setMinLength(minLength) ⇒ InputText

Sets the minimum length of the text input.

Kind: instance method of InputText
Returns: InputText - This component.

ParamTypeDescription
minLengthnumberThe minimum length to set.

inputText.setRequired(required) ⇒ InputText

Sets whether the component is required or not.

Kind: instance method of InputText
Returns: InputText - This component.

ParamTypeDescription
requiredbooleanWhether the component is required or not.

inputText.setPlaceholder(placeholder) ⇒ InputText

Sets the placeholder text for the text input.

Kind: instance method of InputText
Returns: InputText - This component.

ParamTypeDescription
placeholderstringThe placeholder text to set.

inputText.setValue(value) ⇒ InputText

Sets the value of the text input.

Kind: instance method of InputText
Returns: InputText - This component.

ParamTypeDescription
valuestringThe value to set.

inputText.setStyle(style) ⇒ InputText

Sets the style of the component.

Kind: instance method of InputText
Returns: InputText - This component.

ParamTypeDescription
stylestring | numberThe style to set, can be a string or a number.

inputText.toJSON() ⇒ Object

Converts the component to a JSON representation.

Kind: instance method of InputText
Returns: Object - The JSON representation of the component.