Skip to content

Radio Group, Checkbox Group and Checkbox

type: 21 · 22 · 23 Modals

Three components that let the user choose inside a modal, all inside a Label:

Type Name For
21 Radio Group Pick one option out of 2 to 10.
22 Checkbox Group Pick several options out of 1 to 10.
23 Checkbox A single yes / no box.
Preview
Quick survey
How often do you play?*
Every day
Weekends
Now and then
Once a month or less
What are you interested in?*
Tournaments
Giveaways
Voice events
Send me notifications by DM
modal.json
{
"type": 9,
"data": {
"custom_id": "survey",
"title": "Quick survey",
"components": [
{
"type": 18,
"label": "How often do you play?",
"component": {
"type": 21,
"custom_id": "frequency",
"options": [
{
"label": "Every day",
"value": "daily",
"default": true
},
{
"label": "Weekends",
"value": "weekends"
},
{
"label": "Now and then",
"value": "sometimes",
"description": "Once a month or less"
}
]
}
},
{
"type": 18,
"label": "What are you interested in?",
"component": {
"type": 22,
"custom_id": "interests",
"min_values": 0,
"options": [
{
"label": "Tournaments",
"value": "tournaments"
},
{
"label": "Giveaways",
"value": "giveaways",
"default": true
},
{
"label": "Voice events",
"value": "voice"
}
]
}
},
{
"type": 18,
"label": "Send me notifications by DM",
"component": {
"type": 23,
"custom_id": "dm_notifications"
}
}
]
}
}
Field Type Description
type integer required Always 21.
custom_id string required 1-100 characters.
options array of options required 2 to 10 options.
required boolean optional Defaults to true.

You receive: value (string with the picked value, or null if nothing was picked).

Field Type Description
type integer required Always 22.
custom_id string required 1-100 characters.
options array of options required 1 to 10 options.
min_values integer optional 0-10. Defaults to 1. Must be at least 1 if required is true.
max_values integer optional 1-10. Defaults to the number of options.
required boolean optional Defaults to true.

You receive: values (array of strings; [] if nothing was picked).

Field Type Description
type integer required Always 23.
custom_id string required 1-100 characters.
default boolean optional Whether it starts checked.

You receive: value (true if checked, false if not).

Field Type Description
value string required Max 100 characters.
label string required Max 100 characters.
description string optional Max 100 characters.
default boolean optional Whether it starts selected.

Respond to the interaction with the JSON above ("type": 9).