From 8c51320796dbef7d955b3cf5450a0ae32be3a797 Mon Sep 17 00:00:00 2001 From: Shay Date: Wed, 20 Sep 2023 11:46:36 -0400 Subject: [PATCH 1/7] add default select docs --- docs/Change_Log.md | 4 ++++ docs/interactions/Message_Components.md | 30 ++++++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/docs/Change_Log.md b/docs/Change_Log.md index 77da8f656f..fd83ca302a 100644 --- a/docs/Change_Log.md +++ b/docs/Change_Log.md @@ -1,5 +1,9 @@ # Change Log +## Default Value in Autopopulated 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"`). + ## Team Member Roles #### Aug 23, 2023 diff --git a/docs/interactions/Message_Components.md b/docs/interactions/Message_Components.md index 160db6ec2d..4a1727fb5c 100644 --- a/docs/interactions/Message_Components.md +++ b/docs/interactions/Message_Components.md @@ -275,21 +275,24 @@ The payloads for the select menu components are detailed in the [select menu str ###### Select Menu Structure -| Field | Type | Description | -|--------------------|-------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| type | integer | [Type](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object-component-types) of select menu component (text: `3`, user: `5`, role: `6`, mentionable: `7`, channels: `8`) | -| custom_id | string | ID for the select menu; max 100 characters | -| options?\* | array of [select options](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-option-structure) | Specified choices in a select menu (only required and available for string selects (type `3`); max 25 | -| channel_types?\*\* | array of [channel types](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) | List of channel types to include in the channel select component (type `8`) | -| placeholder? | string | Placeholder text if nothing is selected; max 150 characters | -| min_values? | integer | Minimum number of items that must be chosen (defaults to 1); min 0, max 25 | -| max_values? | integer | Maximum number of items that can be chosen (defaults to 1); max 25 | -| disabled? | boolean | Whether select menu is disabled (defaults to `false`) | +| Field | Type | Description | +|-----------------------|---------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| type | integer | [Type](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object-component-types) of select menu component (text: `3`, user: `5`, role: `6`, mentionable: `7`, channels: `8`) | +| custom_id | string | ID for the select menu; max 100 characters | +| options?\* | array of [select options](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-option-structure) | Specified choices in a select menu (only required and available for string selects (type `3`); max 25 | +| channel_types?\*\* | array of [channel types](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) | List of channel types to include in the channel select component (type `8`) | +| placeholder? | string | Placeholder text if nothing is selected; max 150 characters | +| min_values? | integer | Minimum number of items that must be chosen (defaults to 1); min 0, max 25 | +| max_values? | integer | Maximum number of items that can be chosen (defaults to 1); max 25 | +| disabled? | boolean | Whether select menu is disabled (defaults to `false`) | +| default_values?\*\*\* | array of [default value objects](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-default-value-structure) | List of default values for autopopulated select menu components; max length of 25 | \* `options` is required for string select menus (component type `3`), and unavailable for all other select menu components. \*\* `channel_types` can only be used for channel select menu components. +\*\*\* `default_values` is only available for autopopulated select menu components, which include user (`5`), role (`6`), mentionable (`7`), and channel (`8`) [components](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object-component-types). + ###### Select Option Structure | Field | Type | Description | @@ -300,6 +303,13 @@ The payloads for the select menu components are detailed in the [select menu str | emoji? | partial [emoji](#DOCS_RESOURCES_EMOJI/emoji-object) object | `id`, `name`, and `animated` | | default? | boolean | Will show this option as selected by default | +###### 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"` | + ###### Select Menu Interaction ```json From 32567c60697a571cf65bce908a29335d54151d92 Mon Sep 17 00:00:00 2001 From: Shay Date: Wed, 20 Sep 2023 11:56:40 -0400 Subject: [PATCH 2/7] small edits --- docs/Change_Log.md | 2 +- docs/interactions/Message_Components.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/Change_Log.md b/docs/Change_Log.md index fd83ca302a..09cadc0329 100644 --- a/docs/Change_Log.md +++ b/docs/Change_Log.md @@ -1,6 +1,6 @@ # Change Log -## Default Value in Autopopulated Select Menus +## 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"`). diff --git a/docs/interactions/Message_Components.md b/docs/interactions/Message_Components.md index 4a1727fb5c..011e678072 100644 --- a/docs/interactions/Message_Components.md +++ b/docs/interactions/Message_Components.md @@ -215,7 +215,7 @@ There are 5 different [select menu components](#DOCS_INTERACTIONS_MESSAGE_COMPON The string select menu (type `3`) is the *only* select type that allows (and *requires*) apps to define the `options` that appear in the dropdown list. The other 4 select menu components (users, roles, mentionables, and channels) are auto-populated with options corresponding to the resource type—similar to [command option types](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/application-command-object-application-command-option-type). -In addition to the `values` array in all [select menu interaction payloads](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-menu-interaction), auto-populated select menu components (users, roles, mentionables, and channels) also include an additional [`resolved` object](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-menu-resolved-object) that provides additional details about the user's selected resource. +In addition to the `values` array in all [select menu interaction payloads](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-menu-interaction), auto-populated select menu components (user, role, mentionable, and channel) also include an additional [`resolved` object](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-menu-resolved-object) that provides additional details about the user's selected resource. The payloads for the select menu components are detailed in the [select menu structure](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-menu-structure). @@ -282,16 +282,16 @@ The payloads for the select menu components are detailed in the [select menu str | options?\* | array of [select options](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-option-structure) | Specified choices in a select menu (only required and available for string selects (type `3`); max 25 | | channel_types?\*\* | array of [channel types](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) | List of channel types to include in the channel select component (type `8`) | | placeholder? | string | Placeholder text if nothing is selected; max 150 characters | +| default_values?\*\*\* | array of [default value objects](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-default-value-structure) | List of default values for auto-populated select menu components; max of 25 default values | | min_values? | integer | Minimum number of items that must be chosen (defaults to 1); min 0, max 25 | | max_values? | integer | Maximum number of items that can be chosen (defaults to 1); max 25 | | disabled? | boolean | Whether select menu is disabled (defaults to `false`) | -| default_values?\*\*\* | array of [default value objects](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-default-value-structure) | List of default values for autopopulated select menu components; max length of 25 | \* `options` is required for string select menus (component type `3`), and unavailable for all other select menu components. \*\* `channel_types` can only be used for channel select menu components. -\*\*\* `default_values` is only available for autopopulated select menu components, which include user (`5`), role (`6`), mentionable (`7`), and channel (`8`) [components](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object-component-types). +\*\*\* `default_values` is only available for auto-populated select menu components, which include user (`5`), role (`6`), mentionable (`7`), and channel (`8`) [components](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object-component-types). ###### Select Option Structure From c21255b3cbabc616402b3d172f9d8f4084393e78 Mon Sep 17 00:00:00 2001 From: Shay Date: Wed, 20 Sep 2023 11:59:26 -0400 Subject: [PATCH 3/7] classic --- docs/interactions/Message_Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interactions/Message_Components.md b/docs/interactions/Message_Components.md index 011e678072..1c067e6a2f 100644 --- a/docs/interactions/Message_Components.md +++ b/docs/interactions/Message_Components.md @@ -282,7 +282,7 @@ The payloads for the select menu components are detailed in the [select menu str | options?\* | array of [select options](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-option-structure) | Specified choices in a select menu (only required and available for string selects (type `3`); max 25 | | channel_types?\*\* | array of [channel types](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) | List of channel types to include in the channel select component (type `8`) | | placeholder? | string | Placeholder text if nothing is selected; max 150 characters | -| default_values?\*\*\* | array of [default value objects](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-default-value-structure) | List of default values for auto-populated select menu components; max of 25 default values | +| default_values?\*\*\* | array of [default value objects](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-default-value-structure) | List of default values for auto-populated select menu components; max of 25 default values | | min_values? | integer | Minimum number of items that must be chosen (defaults to 1); min 0, max 25 | | max_values? | integer | Maximum number of items that can be chosen (defaults to 1); max 25 | | disabled? | boolean | Whether select menu is disabled (defaults to `false`) | From 619a6777ffb82ca19694f40a27a7fe53bf56b4f4 Mon Sep 17 00:00:00 2001 From: Shay Date: Fri, 22 Sep 2023 12:56:58 -0400 Subject: [PATCH 4/7] add resolved --- docs/resources/Channel.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/resources/Channel.md b/docs/resources/Channel.md index 661a87faf8..843fb0a533 100644 --- a/docs/resources/Channel.md +++ b/docs/resources/Channel.md @@ -299,6 +299,8 @@ Represents a message sent in a channel within Discord. | stickers? | array of [sticker](#DOCS_RESOURCES_STICKER/sticker-object) objects | **Deprecated** the stickers sent with the message | | position? | integer | A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread, it can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread | | role_subscription_data? | [role subscription data](#DOCS_RESOURCES_CHANNEL/role-subscription-data-object) object | data of the role subscription purchase or renewal that prompted this ROLE_SUBSCRIPTION_PURCHASE message | +| resolved? | [resolved](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/interaction-object-resolved-data-structure) data | data for users, members, channels, and roles in the message's [auto-populated select menus](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menus) | + \* The author object follows the structure of the user object, but is only a valid user in the case where the message is generated by a user or bot user. If the message is generated by a webhook, the author object corresponds to the webhook's id, username, and avatar. You can tell if a message is generated by a webhook by checking for the `webhook_id` on the message object. From c6de9f5b69cf06539400d93e1f94f5be81e89fa9 Mon Sep 17 00:00:00 2001 From: shay Date: Fri, 22 Sep 2023 13:34:30 -0400 Subject: [PATCH 5/7] Update docs/interactions/Message_Components.md Co-authored-by: Valle <81811276+Valle-infinitare@users.noreply.github.com> --- docs/interactions/Message_Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interactions/Message_Components.md b/docs/interactions/Message_Components.md index 1c067e6a2f..c8e5f20133 100644 --- a/docs/interactions/Message_Components.md +++ b/docs/interactions/Message_Components.md @@ -282,7 +282,7 @@ The payloads for the select menu components are detailed in the [select menu str | options?\* | array of [select options](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-option-structure) | Specified choices in a select menu (only required and available for string selects (type `3`); max 25 | | channel_types?\*\* | array of [channel types](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) | List of channel types to include in the channel select component (type `8`) | | placeholder? | string | Placeholder text if nothing is selected; max 150 characters | -| default_values?\*\*\* | array of [default value objects](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-default-value-structure) | List of default values for auto-populated select menu components; max of 25 default values | +| default_values?\*\*\* | array of [default value objects](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-default-value-structure) | List of default values for auto-populated select menu components; number of default values must be in the range defined by `min_values` and `max_values` | | min_values? | integer | Minimum number of items that must be chosen (defaults to 1); min 0, max 25 | | max_values? | integer | Maximum number of items that can be chosen (defaults to 1); max 25 | | disabled? | boolean | Whether select menu is disabled (defaults to `false`) | From bd05277ff7d7193fdc6f4e60c452fc973fcfb0fc Mon Sep 17 00:00:00 2001 From: Shay Date: Fri, 22 Sep 2023 13:44:05 -0400 Subject: [PATCH 6/7] add date --- docs/Change_Log.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/Change_Log.md b/docs/Change_Log.md index 09cadc0329..19a06d1e9e 100644 --- a/docs/Change_Log.md +++ b/docs/Change_Log.md @@ -2,6 +2,8 @@ ## Default Value in Auto-populated Select Menus +#### Sep 22, 2023 + 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"`). ## Team Member Roles From 59a55705a3565cb22942c5716bfefa79e383a041 Mon Sep 17 00:00:00 2001 From: Shay Date: Fri, 22 Sep 2023 13:45:27 -0400 Subject: [PATCH 7/7] great i love this so much i love tables i love formatting --- docs/interactions/Message_Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interactions/Message_Components.md b/docs/interactions/Message_Components.md index c8e5f20133..a213562288 100644 --- a/docs/interactions/Message_Components.md +++ b/docs/interactions/Message_Components.md @@ -282,7 +282,7 @@ The payloads for the select menu components are detailed in the [select menu str | options?\* | array of [select options](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-option-structure) | Specified choices in a select menu (only required and available for string selects (type `3`); max 25 | | channel_types?\*\* | array of [channel types](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) | List of channel types to include in the channel select component (type `8`) | | placeholder? | string | Placeholder text if nothing is selected; max 150 characters | -| default_values?\*\*\* | array of [default value objects](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-default-value-structure) | List of default values for auto-populated select menu components; number of default values must be in the range defined by `min_values` and `max_values` | +| default_values?\*\*\* | array of [default value objects](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/select-menu-object-select-default-value-structure) | List of default values for auto-populated select menu components; number of default values must be in the range defined by `min_values` and `max_values` | | min_values? | integer | Minimum number of items that must be chosen (defaults to 1); min 0, max 25 | | max_values? | integer | Maximum number of items that can be chosen (defaults to 1); max 25 | | disabled? | boolean | Whether select menu is disabled (defaults to `false`) |