Skip to content

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

Checkbox.customId  :: string?

Developer-defined identifier; 1-100 characters.

Checkbox.required  :: boolean?

Whether required in modal (defaults to true).

Checkbox.default  :: boolean?

Whether checked by default (defaults to false).

Checkbox : setCustomId ( customId )  -> Checkbox

Sets the developer-defined identifier. 1-100 characters.

Parameters

customId: string

Returns

Checkbox
Checkbox : setRequired ( required )  -> Checkbox

Sets whether this component is required in a modal.

Parameters

required: boolean

Returns

Checkbox
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
Checkbox . new ( resource )  -> Checkbox

Responsible for creating a new Checkbox.

Parameters

resource: {
customId: string?,
required: boolean?,
default: boolean?,
}

Returns

Checkbox