TextInputBuilder

export class TextInputBuilder extends BuilderTextInputComponent
export class TextInputBuilder extends BuilderTextInputComponent
Represents a text input builder.
constructor(data?)
Constructs a new instance of the TextInputBuilder class
NameTypeOptionalDescription
dataPartial<TextInputComponentData | APITextInputComponent>YesNone
Readonly
data:Partial<DataType>
The API data associated with this component.
Inherited from ComponentBuilder
equals(other):boolean
NameTypeOptionalDescription
otherAPITextInputComponent | JSONEncodable<APITextInputComponent>NoNone
Static
from(other):TextInputBuilder
Creates a new text input builder from JSON data
NameTypeOptionalDescription
otherJSONEncodable<APITextInputComponent> | APITextInputComponentNoThe other data
setCustomId(customId):this
Sets the custom id for this text input.
NameTypeOptionalDescription
customIdstringNoThe custom id to use
setLabel(label):this
Sets the label for this text input.
NameTypeOptionalDescription
labelstringNoThe label to use
setMaxLength(maxLength):this
Sets the maximum length of text for this text input.
NameTypeOptionalDescription
maxLengthnumberNoThe maximum length of text for this text input
setMinLength(minLength):this
Sets the minimum length of text for this text input.
NameTypeOptionalDescription
minLengthnumberNoThe minimum length of text for this text input
setPlaceholder(placeholder):this
Sets the placeholder for this text input.
NameTypeOptionalDescription
placeholderstringNoThe placeholder to use
setRequired(required?):this
Sets whether this text input is required.
NameTypeOptionalDescription
requiredbooleanYesWhether this text input is required
setStyle(style):this
Sets the style for this text input.
NameTypeOptionalDescription
styleTextInputStyleNoThe style to use
setValue(value):this
Sets the value for this text input.
NameTypeOptionalDescription
valuestringNoThe value to use
Serializes this builder to API-compatible JSON data.
Remarks
This method runs validations on the data before serializing it. As such, it may throw an error if the data is invalid.