Table of Contents

Class LabelBuilder

Namespace
Discord
Assembly
Discord.Net.Core.dll

Represents a class used to build LabelComponent's.

public class LabelBuilder : IMessageComponentBuilder
Inheritance
LabelBuilder
Implements
Inherited Members
Extension Methods

Constructors

LabelBuilder()

Initializes a new LabelBuilder.

public LabelBuilder()

LabelBuilder(LabelComponent)

Initializes a new LabelBuilder from existing component.

public LabelBuilder(LabelComponent label)

Parameters

label LabelComponent

LabelBuilder(string, IMessageComponentBuilder, string, int?)

Initializes a new LabelBuilder with the specified content.

public LabelBuilder(string label, IMessageComponentBuilder component, string description = null, int? id = null)

Parameters

label string

The label text.

component IMessageComponentBuilder

The component within the label.

description string

The description text for the label.

id int?

The id for the component.

Fields

MaxDescriptionLength

The maximum length of the description.

public const int MaxDescriptionLength = 100

Field Value

int

MaxLabelLength

The maximum length of the label.

public const int MaxLabelLength = 45

Field Value

int

Properties

Component

Gets or sets the component within the label.

public IMessageComponentBuilder Component { get; set; }

Property Value

IMessageComponentBuilder

Description

Gets or sets the description text for the label.

public string Description { get; set; }

Property Value

string

Id

Gets or sets the id for the component. An autoincremented id will be assigned if not set.

public int? Id { get; set; }

Property Value

int?

Label

Gets or sets the label text.

public string Label { get; set; }

Property Value

string

SupportedComponentTypes

Gets the types of child components supported by this container.

public ImmutableArray<ComponentType> SupportedComponentTypes { get; }

Property Value

ImmutableArray<ComponentType>

Type

Gets the type of the component.

public ComponentType Type { get; }

Property Value

ComponentType

Methods

Build()

Runs validation checks and builds the component.

public LabelComponent Build()

Returns

LabelComponent

WithComponent(IMessageComponentBuilder)

Sets the component within the label.

public LabelBuilder WithComponent(IMessageComponentBuilder component)

Parameters

component IMessageComponentBuilder

The component within the label.

Returns

LabelBuilder

The current builder.

WithDescription(string)

Sets the description text for the label.

public LabelBuilder WithDescription(string description)

Parameters

description string

The description text for the label.

Returns

LabelBuilder

The current builder.

WithLabel(string)

Sets the label text.

public LabelBuilder WithLabel(string label)

Parameters

label string

The label text.

Returns

LabelBuilder

The current builder.