TextInput
Implementation of discords TextInput object as a Luau builder.
Summary
Properties
TextInput.customId :: string?TextInput.style :: apiTypes.TextInputStyle?TextInput.label :: string?TextInput.minLength :: number?TextInput.maxLength :: number?TextInput.required :: boolean?TextInput.value :: string?TextInput.placeholder :: string?Methods
TextInput:setCustomId(customId: string) → TextInputTextInput:setStyle(style: apiTypes.TextInputStyle) → TextInputTextInput:setLabel(label: string) → TextInputTextInput:setMinLength(minLength: number) → TextInputTextInput:setMaxLength(maxLength: number) → TextInputTextInput:setIsRequired(isRequired: boolean) → TextInputTextInput:setValue(value: string) → TextInputTextInput:setPlaceholder(placeholder: string) → TextInputTextInput:build() → JSONProperties
Section titled “Properties”customId
Section titled “customId”The custom identifier for the text input component.
The style of the text input component.
The label text that appears above the text input field.
minLength
Section titled “minLength”The minimum length of text that can be entered.
maxLength
Section titled “maxLength”The maximum length of text that can be entered.
required
Section titled “required”Whether this text input field is required to be filled.
The pre-filled value for the text input field.
placeholder
Section titled “placeholder”The placeholder text that appears when no text is entered.
Methods
Section titled “Methods”setCustomId
Section titled “setCustomId”TextInput : setCustomId ( customId ) -> TextInput
Sets the custom identifier for this text input component.
Parameters
| customId: string |
Returns
| TextInput |
setStyle
Section titled “setStyle”TextInput : setStyle ( style ) -> TextInput
Sets the style of the text input component.
Parameters
| style: TextInputStyle |
Returns
| TextInput |
setLabel
Section titled “setLabel”TextInput : setLabel ( label ) -> TextInput
Sets the label text that appears above the text input field.
Parameters
| label: string |
Returns
| TextInput |
setMinLength
Section titled “setMinLength”TextInput : setMinLength ( minLength ) -> TextInput
Sets the minimum length of text that can be entered.
Parameters
| minLength: number |
Returns
| TextInput |
setMaxLength
Section titled “setMaxLength”TextInput : setMaxLength ( maxLength ) -> TextInput
Sets the maximum length of text that can be entered.
Parameters
| maxLength: number |
Returns
| TextInput |
setIsRequired
Section titled “setIsRequired”TextInput : setIsRequired ( isRequired ) -> TextInput
Sets whether this text input field is required to be filled.
Parameters
| isRequired: boolean |
Returns
| TextInput |
setValue
Section titled “setValue”TextInput : setValue ( value ) -> TextInput
Sets the pre-filled value for the text input field.
Parameters
| value: string |
Returns
| TextInput |
setPlaceholder
Section titled “setPlaceholder”TextInput : setPlaceholder ( placeholder ) -> TextInput
Sets the placeholder text that appears when no text is entered.
Parameters
| placeholder: string |
Returns
| TextInput |
TextInput : build ( ) -> JSON
Responsible for building the TextInput JSON that can be parsed by the Discord API.
Returns
| JSON |
Functions
Section titled “Functions”TextInput . new ( resource ) -> TextInput
Responsible for creating a new TextInput.
local textInput = TextInput.new({ customId = "my_text_input", style = TextInputStyle.Short, label = "Enter your name"})