Label
Implementation of Discord’s Label component as a Luau builder. Labels associate a label and description with a single interactive component. Recommended over ActionRow in modals.
https://docs.discord.com/developers/components/reference#label
Summary
Properties
Label.label :: string?Label.description :: string?Label.component :: any?Label.required :: boolean?Properties
Section titled “Properties”The label text; max 45 characters.
description
Section titled “description”Additional description text; max 100 characters.
component
Section titled “component”A component to associate with the label.
required
Section titled “required”Whether this component is required (defaults to true).
Methods
Section titled “Methods”setLabel
Section titled “setLabel”Label : setLabel ( label ) -> Label
Sets the label text. Max 45 characters.
Parameters
| label: string |
Returns
| Label |
setDescription
Section titled “setDescription”Label : setDescription ( description ) -> Label
Sets the description text. Max 100 characters.
Parameters
| description: string |
Returns
| Label |
setComponent
Section titled “setComponent”Label : setComponent ( component ) -> Label
Sets the interactive component to associate with this label.
Parameters
| component: ComponentObjects |
Returns
| Label |
setRequired
Section titled “setRequired”Label : setRequired ( required ) -> Label
Sets whether this component is required in a modal.
Parameters
| required: boolean |
Returns
| Label |
Label : build ( ) -> JSON
Responsible for building the Label JSON that can be parsed by the Discord API.
Returns
| JSON |
Functions
Section titled “Functions”Label . new ( resource ) -> Label
Responsible for creating a new Label.
Parameters
| resource: { label: string?, description: string?, component: apiTypes.ComponentObjects?, required: boolean?, } |
Returns
| Label |