class LabelBuilder

external
declare class LabelBuilder extends ComponentBuilder<APILabelComponent>

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

Constructors

external
constructor()

Creates a new label.

Examples:Creating a label from an API data object:
const label = new LabelBuilder({
	label: "label",
	component,
});
Creating a label using setters and API data:
const label = new LabelBuilder({
	label: 'label',
	component,
}).setContent('new text');

external
clearDescription() : this

Clears the description for this label.

external
clearId() : this

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

Inherited from: ComponentBuilder

external
setDescription(
description: string
) : this

Sets the description for this label.

external
setId(
id: number
) : this

Sets the id of this component.

Inherited from: ComponentBuilder

external
setLabel(
label: string
) : this

Sets the label for this label.

external
setStringSelectMenuComponent() : this

Sets a string select menu component to this label.

external
setTextInputComponent() : this

Sets a text input component to this label.

external
toJSON(
validationOverride?: boolean
) : APILabelComponent

Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.