TextInputComponent
classe · Source
Represents a text input component in a modal
Extends: BaseMessageComponent
Constructor
Parameters
| Name | Type | Description |
|---|---|---|
data? | TextInputComponent | TextInputComponentOptions | TextInputComponent to clone or raw data Default: {}. |
Properties
customId
A unique string to be sent in the interaction when submitted Source
label
The text to be displayed above this text input component Source
maxLength
Maximum length of text that can be entered Source
minLength
Minimum length of text required to be entered Source
placeholder
Custom placeholder text to display when no text is entered Source
required
Whether or not this text input component is required Source
style
The style of this text input component Source
value
Value of this text input component Source
type
The type of this component Source
data
The data for this component Source
id
The id of this component Source
Methods
setValue
Sets the value of this text input component Parameters
| Name | Type | Description |
|---|---|---|
value | string | Value of this text input component |
Returns: TextInputComponentSource
toJSON
Transforms the text input component into a plain object Returns: APITextInput — The raw data of this text input component Source
resolveStyle
Resolves the style of a text input component Parameters
| Name | Type | Description |
|---|---|---|
style | TextInputStyleResolvable | The style to resolve |
Returns: TextInputStyleSource