New Component (Dropdown / Checkbox / Radio) Option (Expression) — DiSky

Addon: DiSky · Category: Expression · Since: 4.28.0

Syntax

[a] new [default] [(dropdown|checkbox|radio)] option with value %string% (named|with label) %-string% [with description [%-string%]] [with [emoji] %-emote%]

Description

Create a new dropdown/checkbox/radio option with different properties. This is a predefined option holding a string value. It can only be used in string dropdowns. The value represent the returned string that this dropdown will return if this option is selected. The name / label is the actual shown name on the option. Description and emote are optional. They will be ignored for checkbox and radio options, as they are only supported in dropdowns.

Examples

set {_radio} to new radio group with id "test2"
add (new radio option with value "option1" named "Option 1") to options of {_radio}
add (new default radio option with value "option2" named "Option 2") to options of {_radio}
set {_checks} to new checkbox group with id "test"
add (new checkbox option with value "option1" named "Option 1") to options of {_checks}
add (new default checkbox option with value "option2" named "Option 2") to options of {_checks}

View source