class TextInputBuilder

export declare class TextInputBuilder extends ComponentBuilder<APITextInputComponent>

A builder that creates API-compatible JSON data for text inputs.

Constructors

constructor()

Creates a new text input from API data.

clearMaxLength() : this

Clears the maximum length of text for this text input.

clearMinLength() : this

Clears the minimum length of text for this text input.

clearPlaceholder() : this

Clears the placeholder for this text input.

clearValue() : this

Clears the value for this text input.

setCustomId(
customId: string
) : this

Sets the custom id for this text input.

setLabel(
label: string
) : this

Sets the label for this text input.

setMaxLength(
maxLength: number
) : this

Sets the maximum length of text for this text input.

setMinLength(
minLength: number
) : this

Sets the minimum length of text for this text input.

setPlaceholder(
placeholder: string
) : this

Sets the placeholder for this text input.

setRequired(
required?: boolean
) : this

Sets whether this text input is required.

setStyle() : this

Sets the style for this text input.

setValue(
value: string
) : this

Sets the value for this text input.

toJSON(
validationOverride?: boolean
) : APITextInputComponent

Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.