Checkbox
Implementation of Discord’s Checkbox component as a Luau builder. Single checkbox for a yes/no choice. Modal-only when using the required field.
https://docs.discord.com/developers/components/reference#checkbox
Summary
Properties
Section titled “Properties”customId
Section titled “customId”Developer-defined identifier; 1-100 characters.
required
Section titled “required”Whether required in modal (defaults to true).
default
Section titled “default”Whether checked by default (defaults to false).
Methods
Section titled “Methods”setCustomId
Section titled “setCustomId”Checkbox : setCustomId ( customId ) -> Checkbox
Sets the developer-defined identifier. 1-100 characters.
Parameters
| customId: string |
Returns
| Checkbox |
setRequired
Section titled “setRequired”Checkbox : setRequired ( required ) -> Checkbox
Sets whether this component is required in a modal.
Parameters
| required: boolean |
Returns
| Checkbox |
setDefault
Section titled “setDefault”Checkbox : setDefault ( default ) -> Checkbox
Sets whether the checkbox is checked by default.
Parameters
| default: boolean |
Returns
| Checkbox |
Checkbox : build ( ) -> JSON
Responsible for building the Checkbox JSON that can be parsed by the Discord API.
Returns
| JSON |
Functions
Section titled “Functions”Checkbox . new ( resource ) -> Checkbox
Responsible for creating a new Checkbox.