class LabelBuilder
extends
ComponentBuilder<APILabelComponent>export declare class LabelBuilder extends ComponentBuilder<APILabelComponent>
A builder that creates API-compatible JSON data for labels.
Constructors
data?: Partial<APILabelComponent>) constructor(
data?: Partial<APILabelComponent>
Creates a new label.
Examples:Creating a label from an API data object:Creating a label using setters and API data:
const label = new LabelBuilder({
label: "label",
component,
});
const label = new LabelBuilder({
label: 'label',
component,
}).setContent('new text');
Clears the id of this component, defaulting to a default incremented id.
Inherited from: ComponentBuilder
setDescriptiondescription: string) : this (
description: string
Sets the description for this label.
setLabellabel: string) : this (
label: string
Sets the label for this label.
setStringSelectMenuComponentinput: APIStringSelectComponent | StringSelectMenuBuilder | ((builder: StringSelectMenuBuilder) => StringSelectMenuBuilder)) : this (
input: APIStringSelectComponent | StringSelectMenuBuilder | ((builder: StringSelectMenuBuilder) => StringSelectMenuBuilder)
Sets a string select menu component to this label.
setTextInputComponentinput: APITextInputComponent | TextInputBuilder | ((builder: TextInputBuilder) => TextInputBuilder)) : this (
input: APITextInputComponent | TextInputBuilder | ((builder: TextInputBuilder) => TextInputBuilder)
Sets a text input component to this label.
toJSONvalidationOverride?: boolean) : APILabelComponent (
validationOverride?: boolean
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.