Preview environment

class LabelBuilder

export declare class LabelBuilder extends ComponentBuilder<LabelBuilderData>

A builder that creates API-compatible JSON data for labels.

readonly
data : Partial<LabelBuilderData>

The API data associated with this component.

Inherited from: ComponentBuilder

clearDescription() : this

Clears the description for this label.

clearId() : this

Clears the id of this component, defaulting to a default incremented id.

Inherited from: ComponentBuilder

setChannelSelectMenuComponent() : this

Sets a channel select menu component to this label.

setDescription(
description: string
) : this

Sets the description for this label.

setId(
id: number
) : this

Sets the id (not the custom id) for this component.

Inherited from: ComponentBuilder

setLabel(
label: string
) : this

Sets the label for this label.

Sets a mentionable select menu component to this label.

setRoleSelectMenuComponent() : this

Sets a role select menu component to this label.

setStringSelectMenuComponent() : this

Sets a string select menu component to this label.

setTextInputComponent() : this

Sets a text input component to this label.

setUserSelectMenuComponent() : this

Sets a user select menu component to this label.

toJSON() : APILabelComponent

Serializes this builder to API-compatible JSON data.