Constructor DiscordTextComponent
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
DiscordTextComponent(DiscordTextComponent)
Constructs a new text component based on another text component.
public DiscordTextComponent(DiscordTextComponent other)
Parameters
other
DiscordTextComponentThe button to copy.
DiscordTextComponent(TextComponentStyle, string, string, string, int?, int?, bool, string)
Constructs a new text component field with the specified options.
public DiscordTextComponent(TextComponentStyle style, string customId = null, string label = null, string placeholder = null, int? minLength = null, int? maxLength = null, bool required = true, string defaultValue = null)
Parameters
style
TextComponentStyleThe style of the text component.
customId
stringThe Id to assign to the text component. This is sent back when a user presses it.
label
stringThe text to display before the text component, up to 80 characters. Required, but set to null to avoid breaking change.
placeholder
stringThe placeholder for the text input.
minLength
int?The minimal length of text input.
maxLength
int?The maximal length of text input.
required
boolWhether this text component should be required.
defaultValue
stringPre-filled value for text field.
Exceptions
- ArgumentException
Is thrown when no label is set.