Class InputComponentBuilder<TInfo, TBuilder>
- Namespace
- Discord.Interactions.Builders
- Assembly
- Discord.Net.Interactions.dll
Represents the base builder class for creating InputComponentInfo.
public abstract class InputComponentBuilder<TInfo, TBuilder> : IInputComponentBuilder where TInfo : InputComponentInfo where TBuilder : InputComponentBuilder<TInfo, TBuilder>
Type Parameters
TInfo
The InputComponentInfo this builder yields when built.
TBuilder
Inherited InputComponentBuilder<TInfo, TBuilder> type.
- Inheritance
-
InputComponentBuilder<TInfo, TBuilder>
- Implements
- Derived
- Inherited Members
Constructors
InputComponentBuilder(ModalBuilder)
Creates an instance of InputComponentBuilder<TInfo, TBuilder>
public InputComponentBuilder(ModalBuilder modal)
Parameters
modal
ModalBuilderParent modal of this input component.
Properties
Attributes
Gets a collection of the attributes of this component.
public IReadOnlyCollection<Attribute> Attributes { get; }
Property Value
ComponentType
Gets the component type of this input component.
public ComponentType ComponentType { get; }
Property Value
CustomId
Gets the custom id of this input component.
public string CustomId { get; set; }
Property Value
DefaultValue
Gets the default value of this input component.
public object DefaultValue { get; set; }
Property Value
Instance
protected abstract TBuilder Instance { get; }
Property Value
- TBuilder
IsRequired
Gets whether this input component is required.
public bool IsRequired { get; set; }
Property Value
Label
Gets the label of this input component.
public string Label { get; set; }
Property Value
Modal
Gets the parent modal of this input component.
public ModalBuilder Modal { get; }
Property Value
PropertyInfo
Get the PropertyInfo of this component's property.
public PropertyInfo PropertyInfo { get; }
Property Value
Type
Get the reference type of this input component.
public Type Type { get; }
Property Value
TypeConverter
Get the ComponentTypeConverter assigned to this input.
public ComponentTypeConverter TypeConverter { get; }
Property Value
Methods
SetDefaultValue(object)
Sets DefaultValue.
public TBuilder SetDefaultValue(object value)
Parameters
value
objectNew value of the DefaultValue.
Returns
- TBuilder
The builder instance.
SetIsRequired(bool)
Sets IsRequired.
public TBuilder SetIsRequired(bool isRequired)
Parameters
isRequired
boolNew value of the IsRequired.
Returns
- TBuilder
The builder instance.
WithAttributes(params Attribute[])
Adds attributes to Attributes.
public TBuilder WithAttributes(params Attribute[] attributes)
Parameters
attributes
Attribute[]New attributes to be added to Attributes.
Returns
- TBuilder
The builder instance.
WithComponentType(ComponentType)
Sets ComponentType.
public TBuilder WithComponentType(ComponentType componentType)
Parameters
componentType
ComponentTypeNew value of the ComponentType.
Returns
- TBuilder
The builder instance.
WithCustomId(string)
Sets CustomId.
public TBuilder WithCustomId(string customId)
Parameters
Returns
- TBuilder
The builder instance.
WithLabel(string)
Sets Label.
public TBuilder WithLabel(string label)
Parameters
Returns
- TBuilder
The builder instance.
WithType(Type)
Sets Type.
public TBuilder WithType(Type type)
Parameters
Returns
- TBuilder
The builder instance.