InputText
InputText
Represents an Input Text component for a Discord interaction message.
Kind: global class
- InputText
- new InputText([data])
- .setCustomId(customId) ⇒
InputText
- .setLabel(label) ⇒
InputText
- .setMaxLength(maxLength) ⇒
InputText
- .setMinLength(minLength) ⇒
InputText
- .setRequired(required) ⇒
InputText
- .setPlaceholder(placeholder) ⇒
InputText
- .setValue(value) ⇒
InputText
- .setStyle(style) ⇒
InputText
- .toJSON() ⇒
Object
new InputText([data])
Constructs a new InputText component.
Param | Type | Description |
---|---|---|
[data] | Object | Optional data to set for the component. |
[data.custom_id] | string | The custom ID of the component. |
[data.style] | string | number | The style of the component, can be a string or a number. |
[data.label] | string | The label of the component. |
[data.min_length] | number | The minimum length of the text input. |
[data.max_length] | number | The maximum length of the text input. |
[data.required] | boolean | Whether the component is required or not. |
[data.value] | string | The value of the text input. |
[data.placeholder] | string | The 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.
Param | Type | Description |
---|---|---|
customId | string | The custom ID to set. |
inputText.setLabel(label) ⇒ InputText
Sets the label of the component.
Kind: instance method of InputText
Returns: InputText
- This component.
Param | Type | Description |
---|---|---|
label | string | The label to set. |
inputText.setMaxLength(maxLength) ⇒ InputText
Sets the maximum length of the text input.
Kind: instance method of InputText
Returns: InputText
- This component.
Param | Type | Description |
---|---|---|
maxLength | number | The 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.
Param | Type | Description |
---|---|---|
minLength | number | The 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.
Param | Type | Description |
---|---|---|
required | boolean | Whether 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.
Param | Type | Description |
---|---|---|
placeholder | string | The placeholder text to set. |
inputText.setValue(value) ⇒ InputText
Sets the value of the text input.
Kind: instance method of InputText
Returns: InputText
- This component.
Param | Type | Description |
---|---|---|
value | string | The value to set. |
inputText.setStyle(style) ⇒ InputText
Sets the style of the component.
Kind: instance method of InputText
Returns: InputText
- This component.
Param | Type | Description |
---|---|---|
style | string | number | The 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.