Table of Contents

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)

public InputComponentBuilder(ModalBuilder modal)

Parameters

modal ModalBuilder

Parent modal of this input component.

Properties

Attributes

Gets a collection of the attributes of this component.

public IReadOnlyCollection<Attribute> Attributes { get; }

Property Value

IReadOnlyCollection<Attribute>

ComponentType

Gets the component type of this input component.

public ComponentType ComponentType { get; }

Property Value

ComponentType

CustomId

Gets the custom id of this input component.

public string CustomId { get; set; }

Property Value

string

DefaultValue

Gets the default value of this input component.

public object DefaultValue { get; set; }

Property Value

object

Instance

protected abstract TBuilder Instance { get; }

Property Value

TBuilder

IsRequired

Gets whether this input component is required.

public bool IsRequired { get; set; }

Property Value

bool

Label

Gets the label of this input component.

public string Label { get; set; }

Property Value

string

Modal

Gets the parent modal of this input component.

public ModalBuilder Modal { get; }

Property Value

ModalBuilder

PropertyInfo

Get the PropertyInfo of this component's property.

public PropertyInfo PropertyInfo { get; }

Property Value

PropertyInfo

Type

Get the reference type of this input component.

public Type Type { get; }

Property Value

Type

TypeConverter

Get the ComponentTypeConverter assigned to this input.

public ComponentTypeConverter TypeConverter { get; }

Property Value

ComponentTypeConverter

Methods

SetDefaultValue(object)

public TBuilder SetDefaultValue(object value)

Parameters

value object

New value of the DefaultValue.

Returns

TBuilder

The builder instance.

SetIsRequired(bool)

Sets IsRequired.

public TBuilder SetIsRequired(bool isRequired)

Parameters

isRequired bool

New 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)

public TBuilder WithComponentType(ComponentType componentType)

Parameters

componentType ComponentType

New value of the ComponentType.

Returns

TBuilder

The builder instance.

WithCustomId(string)

Sets CustomId.

public TBuilder WithCustomId(string customId)

Parameters

customId string

New value of the CustomId.

Returns

TBuilder

The builder instance.

WithLabel(string)

Sets Label.

public TBuilder WithLabel(string label)

Parameters

label string

New value of the Label.

Returns

TBuilder

The builder instance.

WithType(Type)

Sets Type.

public TBuilder WithType(Type type)

Parameters

type Type

New value of the Type.

Returns

TBuilder

The builder instance.