Table of Contents

Constructor DiscordTextInputComponent

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

DiscordTextInputComponent(DiscordTextInputComponent)

Constructs a new text component based on another text component.

public DiscordTextInputComponent(DiscordTextInputComponent other)

Parameters

other DiscordTextInputComponent

The button to copy.

DiscordTextInputComponent(TextComponentStyle, string, string?, string?, int?, int?, bool, string)

Constructs a new text component field with the specified options.

[DiscordDeprecated("Deprecated in favor of DiscordLabelComponent. Use overload without label in the new component.")]
public DiscordTextInputComponent(TextComponentStyle style, string label, string? customId = null, string? placeholder = null, int? minLength = null, int? maxLength = null, bool required = true, string defaultValue = null)

Parameters

style TextComponentStyle

The style of the text component.

label string

The text to display before the text component, up to 80 characters.

customId string

The Id to assign to the text component.

placeholder string

The placeholder for the text input.

minLength int?

The minimal length of text input.

maxLength int?

The maximal length of text input.

required bool

Whether this text component should be required.

defaultValue string

Pre-filled value for text field.

Exceptions

ArgumentException

Is thrown when no label is set.

DiscordTextInputComponent(TextComponentStyle, string?, string?, int?, int?, bool, string)

Constructs a new text component field with the specified options.

public DiscordTextInputComponent(TextComponentStyle style, string? customId = null, string? placeholder = null, int? minLength = null, int? maxLength = null, bool required = true, string defaultValue = null)

Parameters

style TextComponentStyle

The style of the text component.

customId string

The Id to assign to the text component.

placeholder string

The placeholder for the text input.

minLength int?

The minimal length of text input.

maxLength int?

The maximal length of text input.

required bool

Whether this text component should be required.

defaultValue string

Pre-filled value for text field.