RadioGroup
Implementation of Discord’s Radio Group component as a Luau builder. Single-choice set of options. Modal-only when using the required field.
https://docs.discord.com/developers/components/reference#radio-group
Summary
Properties
RadioGroup.customId :: string?RadioGroup.options :: { apiTypes.RadioGroupOptionObject }RadioGroup.required :: boolean?Methods
RadioGroup:setCustomId(customId: string) → RadioGroupRadioGroup:addOption(label: string, value: string, description: string?, emoji: apiTypes.EmojiObject?, default: boolean?) → RadioGroupRadioGroup:setRequired(required: boolean) → RadioGroupRadioGroup:build() → JSONFunctions
RadioGroup.new() → RadioGroupProperties
Section titled “Properties”customId
Section titled “customId”Developer-defined identifier; 1-100 characters.
options
Section titled “options” RadioGroup.options :: RadioGroupOptionObject }
Array of radio options; max 10.
required
Section titled “required”Whether required in modal (defaults to true).
Methods
Section titled “Methods”setCustomId
Section titled “setCustomId”RadioGroup : setCustomId ( customId ) -> RadioGroup
Sets the developer-defined identifier. 1-100 characters.
Parameters
| customId: string |
Returns
| RadioGroup |
addOption
Section titled “addOption”RadioGroup : addOption ( label , value , description , emoji , default ) -> RadioGroup
Adds a radio option. Max 10 options.
Returns
| RadioGroup |
setRequired
Section titled “setRequired”RadioGroup : setRequired ( required ) -> RadioGroup
Sets whether this component is required in a modal.
Parameters
| required: boolean |
Returns
| RadioGroup |
RadioGroup : build ( ) -> JSON
Responsible for building the RadioGroup JSON that can be parsed by the Discord API.
Returns
| JSON |
Functions
Section titled “Functions”RadioGroup . new ( ) -> RadioGroup
Responsible for creating a new RadioGroup.
Returns
| RadioGroup |