-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default select menu values #6442
Conversation
###### Select Default Value Structure | ||
|
||
| Field | Type | Description | | ||
|-------|-----------|-------------------------------------------------------------------------------| | ||
| id | snowflake | ID of a user, role, or channel | | ||
| type | string | Type of value that `id` represents. Either `"user"`, `"role"`, or `"channel"` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there plans for select menu default values to support the "default" property like select menu options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would that be for? presence in default_values makes it a default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I thought default values were like choices but for non string type selects.
In that case, is validation for the min/max_values and proper types (going to be) enforced on default values as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is validation for the min/max_values and proper types (going to be) enforced on default values as well
I can confirm from my testing that those validations are actually enforced
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm from my testing that those validations are actually enforced
Would be worth noting then imo
@@ -1,5 +1,9 @@ | |||
# Change Log | |||
|
|||
## Default Value in Auto-populated Select Menus | |||
|
|||
A new `default_values` field was added for user (`5`), role (`6`), mentionable (`7`), and channel (`8`) [select menu components](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menus). `default_values` is a list of [default value objects](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-default-value-structure), which each include an `id` (the snowflake value for the resource), as well as a corresponding `type` (either `"user"`, `"role"`, or `"channel"`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new `default_values` field was added for user (`5`), role (`6`), mentionable (`7`), and channel (`8`) [select menu components](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menus). `default_values` is a list of [default value objects](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-default-value-structure), which each include an `id` (the snowflake value for the resource), as well as a corresponding `type` (either `"user"`, `"role"`, or `"channel"`). | |
A new `default_values` field was added for user (`5`), role (`6`), mentionable (`7`), and channel (`8`) [select menu components](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menus). `default_values` is a list of [default value objects](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-default-value-structure), which each include an `id` (the snowflake value for the resource), as well as its corresponding `type` (either `"user"`, `"role"`, or `"channel"`). |
yes, mentionable has always been users and roles |
oh right. nvm then! |
|
||
| Field | Type | Description | | ||
|-------|-----------|-------------------------------------------------------------------------------| | ||
| id | snowflake | ID of a user, role, or channel | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| id | snowflake | ID of a user, role, or channel | | |
| id | snowflake | ID of a user, role, or channel; depending on the select menu type | |
###### Select Default Value Structure | ||
|
||
| Field | Type | Description | | ||
|-------|-----------|-------------------------------------------------------------------------------| | ||
| id | snowflake | ID of a user, role, or channel | | ||
| type | string | Type of value that `id` represents. Either `"user"`, `"role"`, or `"channel"` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm from my testing that those validations are actually enforced
Would be worth noting then imo
Co-authored-by: Valle <[email protected]>
Not the table again 😂 |
discord/discord-api-docs#6442 Signed-off-by: mccoderpy <[email protected]>
The DSL looks like this: val message = channel.createMessage { actionRow { mentionableSelect("customId") { allowedValues = 0..5 defaultUsers += userId defaultRoles += roleId } } } See discord/discord-api-docs#6442
The DSL looks like this: val message = channel.createMessage { actionRow { mentionableSelect("customId") { allowedValues = 0..5 defaultUsers += userId defaultRoles += roleId } } } See discord/discord-api-docs#6442
* add default select docs * small edits * classic * add resolved * Update docs/interactions/Message_Components.md Co-authored-by: Valle <[email protected]> * add date * great i love this so much i love tables i love formatting --------- Co-authored-by: Valle <[email protected]>
New
default_values
array for auto-populated select menus