CoreClasses
TextInput
Extends
Constructors
new TextInput()
new TextInput(
data
?):TextInput
Parameters
Parameter | Type |
---|---|
data ? | object |
data.additionalData ? | ComponentAdditionalData |
Returns
Inherited from
Properties
Property | Modifier | Type | Default value | Description | Overrides | Inherited from |
---|---|---|---|---|---|---|
additionalData | public | null | ComponentAdditionalData | null | - | - | BaseComponent .additionalData |
customId | abstract | string | undefined | The custom ID of the text input | BaseComponent .customId | - |
defer | public | boolean | false | Whether the component response should be automatically deferred | - | BaseComponent .defer |
ephemeral | public | boolean | false | Whether the component response should be ephemeral | - | BaseComponent .ephemeral |
label | abstract | string | undefined | The label of the text input | - | - |
maxLength? | public | number | undefined | The maximum length of the text input | - | - |
minLength? | public | number | undefined | The minimum length of the text input | - | - |
placeholder? | public | string | undefined | The placeholder of the text input | - | - |
required? | public | boolean | undefined | Whether the text input is required | - | - |
style | public | TextInputStyle | TextInputStyle.Short | The style of the text input Default TextInputStyle.Short | - | - |
type | public | ComponentType | ComponentType.TextInput | The type of the component | BaseComponent .type | - |
value? | public | string | undefined | The value of the text input | - | - |
Methods
createId()
createId(
additionalData
):string
Create a custom ID to use for this component that embeds additional data that you want to be handed
Parameters
Parameter | Type | Description |
---|---|---|
additionalData | null | ComponentAdditionalData | The additional data that you want to be passed in this component's custom ID |
Returns
string
The custom ID to use
Inherited from
serialize()
serialize():
APITextInputComponent
Returns
APITextInputComponent
Overrides
BaseComponent.serialize