A builder that creates API-compatible JSON data for labels.
Extends
ComponentBuilder<LabelBuilderData>Creates a new label.
Example
Creating a label from an API data object:Example
Creating a label using setters and API data:Name | Type | Optional | Description |
---|---|---|---|
data | Partial<APILabelComponent> | Yes | The API data to create this label with |
The API data associated with this component.
Inherited from ComponentBuilderClears the description for this label.
Clears the id of this component, defaulting to a default incremented id.
Inherited from ComponentBuilderSets a channel select menu component to this label.
Name | Type | Optional | Description |
---|---|---|---|
input | APIChannelSelectComponent | ChannelSelectMenuBuilder | ((builder: ChannelSelectMenuBuilder) => ChannelSelectMenuBuilder) | No | A function that returns a component builder or an already built builder |
Sets the description for this label.
Name | Type | Optional | Description |
---|---|---|---|
description | string | No | The description to use |
Sets the id (not the custom id) for this component.
Name | Type | Optional | Description |
---|---|---|---|
id | number | No | The id for this component |
Sets the label for this label.
Name | Type | Optional | Description |
---|---|---|---|
label | string | No | The label to use |
Sets a mentionable select menu component to this label.
Name | Type | Optional | Description |
---|---|---|---|
input | APIMentionableSelectComponent | MentionableSelectMenuBuilder | ((builder: MentionableSelectMenuBuilder) => MentionableSelectMenuBuilder) | No | A function that returns a component builder or an already built builder |
Sets a role select menu component to this label.
Name | Type | Optional | Description |
---|---|---|---|
input | APIRoleSelectComponent | RoleSelectMenuBuilder | ((builder: RoleSelectMenuBuilder) => RoleSelectMenuBuilder) | No | A function that returns a component builder or an already built builder |
Sets a string select menu component to this label.
Name | Type | Optional | Description |
---|---|---|---|
input | APIStringSelectComponent | StringSelectMenuBuilder | ((builder: StringSelectMenuBuilder) => StringSelectMenuBuilder) | No | A function that returns a component builder or an already built builder |
Sets a text input component to this label.
Name | Type | Optional | Description |
---|---|---|---|
input | APITextInputComponent | TextInputBuilder | ((builder: TextInputBuilder) => TextInputBuilder) | No | A function that returns a component builder or an already built builder |
Sets a user select menu component to this label.
Name | Type | Optional | Description |
---|---|---|---|
input | APIUserSelectComponent | UserSelectMenuBuilder | ((builder: UserSelectMenuBuilder) => UserSelectMenuBuilder) | No | A function that returns a component builder or an already built builder |
Serializes this builder to API-compatible JSON data.