From ced77a39f3fbe3cd3c5ef2026f04e62b655b8c19 Mon Sep 17 00:00:00 2001 From: Ander Swift Date: Fri, 2 Aug 2024 11:52:54 -0700 Subject: [PATCH 1/8] document the poll result message and embed --- docs/resources/Message.md | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/docs/resources/Message.md b/docs/resources/Message.md index 55f669b0ba..18a73bc25b 100644 --- a/docs/resources/Message.md +++ b/docs/resources/Message.md @@ -104,6 +104,7 @@ Represents a message sent in a channel within Discord. | GUILD_INCIDENT_REPORT_RAID | 38 | true | | GUILD_INCIDENT_REPORT_FALSE_ALARM | 39 | true | | PURCHASE_NOTIFICATION | 44 | true | +| POLL_RESULT | 46 | true | \* Can only be deleted by members with `MANAGE_MESSAGES` permission @@ -345,6 +346,21 @@ There are multiple message types that have a `message_reference` object. - These messages have `message_id`, `channel_id`, and `guild_id`. - These messages will never have content, embeds, or attachments, mainly just the `message_reference` and `referenced_message` fields. +###### Poll result messages + +- These are automatic messages sent after a poll has ended and the results have been finalized. (type 46) +- These messages have `message_id` and `channel_id`, which point to the original poll message. The `channel_id` will be the same as that of the poll. +- The author will be the same as the author of the poll, and they will mention the author of the poll. +- These messages contain a `poll_result` embed that can have the following fields: + - `poll_question_text` contains the question text from the original poll message. + - `victor_answer_votes` contains the number of votes for the answer(s) with the most votes. + - `total_votes` contains the total number of votes in the poll. + - `victor_answer_id` contains the id for the winning answer, if applicable. + - `victor_answer_text` contains the text for the winning answer, if applicable. + - `victor_answer_emoji_id` contains the id for the emoji associated with the winning answer, if applicable. + - `victor_answer_emoji_name` contains the name of the emoji associated with the winning answer, if applicable. + - `victor_answer_emoji_animated` specifies whether the emoji associated with the winning answer is animated, if applicable. + #### Voice Messages Voice messages are messages with the `IS_VOICE_MESSAGE` flag. They have the following properties. @@ -422,14 +438,15 @@ The reaction count details object contains a breakdown of normal and super react Embed types are "loosely defined" and, for the most part, are not used by our clients for rendering. Embed attributes power what is rendered. Embed types should be considered deprecated and might be removed in a future API version. -| Type | Description | -|---------|----------------------------------------------------| -| rich | generic embed rendered from embed attributes | -| image | image embed | -| video | video embed | -| gifv | animated gif image embed rendered as a video embed | -| article | article embed | -| link | link embed | +| Type | Description | +|-------------|---------------------------------------------------------------------------------------------------------| +| rich | generic embed rendered from embed attributes | +| image | image embed | +| video | video embed | +| gifv | animated gif image embed rendered as a video embed | +| article | article embed | +| link | link embed | +| poll_result | [poll result embed](#DOCS_RESOURCES_MESSAGE/message-reference-content-attribution-poll-result-messages) | ###### Embed Thumbnail Structure From 409be51825d6898f2a2c5083a30593a35d3e6711 Mon Sep 17 00:00:00 2001 From: Ander Swift Date: Fri, 2 Aug 2024 17:30:57 -0700 Subject: [PATCH 2/8] fix redundant language Co-authored-by: val.le <81811276+valdotle@users.noreply.github.com> --- docs/resources/Message.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/Message.md b/docs/resources/Message.md index 18a73bc25b..af8aa735cc 100644 --- a/docs/resources/Message.md +++ b/docs/resources/Message.md @@ -350,7 +350,7 @@ There are multiple message types that have a `message_reference` object. - These are automatic messages sent after a poll has ended and the results have been finalized. (type 46) - These messages have `message_id` and `channel_id`, which point to the original poll message. The `channel_id` will be the same as that of the poll. -- The author will be the same as the author of the poll, and they will mention the author of the poll. +- The author will be the same as the author of the poll and will be mentioned. - These messages contain a `poll_result` embed that can have the following fields: - `poll_question_text` contains the question text from the original poll message. - `victor_answer_votes` contains the number of votes for the answer(s) with the most votes. From 144fe78585db84b26ef0d263544187cc7a1c64d1 Mon Sep 17 00:00:00 2001 From: Ander Swift Date: Wed, 14 Aug 2024 18:23:52 -0700 Subject: [PATCH 3/8] create a new section for embed fields by embed type --- docs/resources/Message.md | 45 +++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/docs/resources/Message.md b/docs/resources/Message.md index af8aa735cc..83fa65b891 100644 --- a/docs/resources/Message.md +++ b/docs/resources/Message.md @@ -351,15 +351,7 @@ There are multiple message types that have a `message_reference` object. - These are automatic messages sent after a poll has ended and the results have been finalized. (type 46) - These messages have `message_id` and `channel_id`, which point to the original poll message. The `channel_id` will be the same as that of the poll. - The author will be the same as the author of the poll and will be mentioned. -- These messages contain a `poll_result` embed that can have the following fields: - - `poll_question_text` contains the question text from the original poll message. - - `victor_answer_votes` contains the number of votes for the answer(s) with the most votes. - - `total_votes` contains the total number of votes in the poll. - - `victor_answer_id` contains the id for the winning answer, if applicable. - - `victor_answer_text` contains the text for the winning answer, if applicable. - - `victor_answer_emoji_id` contains the id for the emoji associated with the winning answer, if applicable. - - `victor_answer_emoji_name` contains the name of the emoji associated with the winning answer, if applicable. - - `victor_answer_emoji_animated` specifies whether the emoji associated with the winning answer is animated, if applicable. +- These messages contain a [`poll_result` embed](#DOCS_RESOURCES_MESSAGE/embed-fields-by-embed-type-poll-result-embed-type) #### Voice Messages @@ -438,15 +430,15 @@ The reaction count details object contains a breakdown of normal and super react Embed types are "loosely defined" and, for the most part, are not used by our clients for rendering. Embed attributes power what is rendered. Embed types should be considered deprecated and might be removed in a future API version. -| Type | Description | -|-------------|---------------------------------------------------------------------------------------------------------| -| rich | generic embed rendered from embed attributes | -| image | image embed | -| video | video embed | -| gifv | animated gif image embed rendered as a video embed | -| article | article embed | -| link | link embed | -| poll_result | [poll result embed](#DOCS_RESOURCES_MESSAGE/message-reference-content-attribution-poll-result-messages) | +| Type | Description | +|-------------|------------------------------------------------------------------------------------------------| +| rich | generic embed rendered from embed attributes | +| image | image embed | +| video | video embed | +| gifv | animated gif image embed rendered as a video embed | +| article | article embed | +| link | link embed | +| poll_result | [poll result embed](#DOCS_RESOURCES_MESSAGE/embed-fields-by-embed-type-poll-result-embed-type) | ###### Embed Thumbnail Structure @@ -527,6 +519,23 @@ Additionally, the combined sum of characters in all `title`, `description`, `fie Embeds are deduplicated by URL. If a message contains multiple embeds with the same URL, only the first is shown. +#### Embed Fields by Embed Type + +[Embed field objects](#DOCS_RESOURCES_MESSAGE/embed-object-embed-field-structure) are used to include additional data in key-value pairs. Below is a reference of possible embed fields for each of the following embed types. + +###### Poll Result Embed Type + +| Embed Field Name | Embed Field Value Description | +|-------------------------------|------------------------------------------------------------| +| poll_question_text | the question text from the original poll | +| victor_answer_votes | number of votes for the answer(s) with the most votes | +| total_votes | total number of votes in the poll | +| victor_answer_id? | the id for the winning answer | +| victor_answer_text? | the text for the winning answer | +| victor_answer_emoji_id? | the id for an emoji associated with the winning answer | +| victor_answer_emoji_name? | the name of an emoji associated with the winning answer | +| victor_answer_emoji_animated? | if an emoji associated with the winning answer is animated | + ### Attachment Object ###### Attachment Structure From 222889c689ccd8c8302bc7e8ff08f284a31ca845 Mon Sep 17 00:00:00 2001 From: Advaith Jagathesan Date: Wed, 14 Aug 2024 21:50:33 -0700 Subject: [PATCH 4/8] edit text --- docs/resources/Message.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/resources/Message.md b/docs/resources/Message.md index 83fa65b891..fc1e9f0a66 100644 --- a/docs/resources/Message.md +++ b/docs/resources/Message.md @@ -428,8 +428,6 @@ The reaction count details object contains a breakdown of normal and super react ###### Embed Types -Embed types are "loosely defined" and, for the most part, are not used by our clients for rendering. Embed attributes power what is rendered. Embed types should be considered deprecated and might be removed in a future API version. - | Type | Description | |-------------|------------------------------------------------------------------------------------------------| | rich | generic embed rendered from embed attributes | @@ -521,9 +519,9 @@ Embeds are deduplicated by URL. If a message contains multiple embeds with the #### Embed Fields by Embed Type -[Embed field objects](#DOCS_RESOURCES_MESSAGE/embed-object-embed-field-structure) are used to include additional data in key-value pairs. Below is a reference of possible embed fields for each of the following embed types. +Certain embed types are used to power special UIs. These embeds use [fields](#DOCS_RESOURCES_MESSAGE/embed-object-embed-field-structure) to include additional data in key-value pairs. Below is a reference of possible embed fields for each of the following embed types. -###### Poll Result Embed Type +###### Poll Result Embed Fields | Embed Field Name | Embed Field Value Description | |-------------------------------|------------------------------------------------------------| From 26998d33381a9f030db092c4f94ea4cc3247e6fa Mon Sep 17 00:00:00 2001 From: Advaith Jagathesan Date: Wed, 14 Aug 2024 21:55:03 -0700 Subject: [PATCH 5/8] links --- docs/resources/Message.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/resources/Message.md b/docs/resources/Message.md index fc1e9f0a66..9ee3f491a0 100644 --- a/docs/resources/Message.md +++ b/docs/resources/Message.md @@ -351,7 +351,7 @@ There are multiple message types that have a `message_reference` object. - These are automatic messages sent after a poll has ended and the results have been finalized. (type 46) - These messages have `message_id` and `channel_id`, which point to the original poll message. The `channel_id` will be the same as that of the poll. - The author will be the same as the author of the poll and will be mentioned. -- These messages contain a [`poll_result` embed](#DOCS_RESOURCES_MESSAGE/embed-fields-by-embed-type-poll-result-embed-type) +- These messages contain a [`poll_result` embed](#DOCS_RESOURCES_MESSAGE/embed-fields-by-embed-type-poll-result-embed-fields) #### Voice Messages @@ -428,15 +428,15 @@ The reaction count details object contains a breakdown of normal and super react ###### Embed Types -| Type | Description | -|-------------|------------------------------------------------------------------------------------------------| -| rich | generic embed rendered from embed attributes | -| image | image embed | -| video | video embed | -| gifv | animated gif image embed rendered as a video embed | -| article | article embed | -| link | link embed | -| poll_result | [poll result embed](#DOCS_RESOURCES_MESSAGE/embed-fields-by-embed-type-poll-result-embed-type) | +| Type | Description | +|-------------|--------------------------------------------------------------------------------------------------| +| rich | generic embed rendered from embed attributes | +| image | image embed | +| video | video embed | +| gifv | animated gif image embed rendered as a video embed | +| article | article embed | +| link | link embed | +| poll_result | [poll result embed](#DOCS_RESOURCES_MESSAGE/embed-fields-by-embed-type-poll-result-embed-fields) | ###### Embed Thumbnail Structure From ee95649a852e964f3f4bd52b1b5d8d3b9c0d4940 Mon Sep 17 00:00:00 2001 From: shay Date: Fri, 16 Aug 2024 12:08:16 -0400 Subject: [PATCH 6/8] Update docs/resources/Message.md --- docs/resources/Message.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/resources/Message.md b/docs/resources/Message.md index 9ee3f491a0..c080048ef3 100644 --- a/docs/resources/Message.md +++ b/docs/resources/Message.md @@ -525,13 +525,13 @@ Certain embed types are used to power special UIs. These embeds use [fields](#DO | Embed Field Name | Embed Field Value Description | |-------------------------------|------------------------------------------------------------| -| poll_question_text | the question text from the original poll | +| poll_question_text | question text from the original poll | | victor_answer_votes | number of votes for the answer(s) with the most votes | | total_votes | total number of votes in the poll | -| victor_answer_id? | the id for the winning answer | -| victor_answer_text? | the text for the winning answer | -| victor_answer_emoji_id? | the id for an emoji associated with the winning answer | -| victor_answer_emoji_name? | the name of an emoji associated with the winning answer | +| victor_answer_id? | id for the winning answer | +| victor_answer_text? | text for the winning answer | +| victor_answer_emoji_id? | id for an emoji associated with the winning answer | +| victor_answer_emoji_name? | name of an emoji associated with the winning answer | | victor_answer_emoji_animated? | if an emoji associated with the winning answer is animated | ### Attachment Object From 59c34592be62ced0c4ac3991a728dc74568c97cb Mon Sep 17 00:00:00 2001 From: shay Date: Fri, 16 Aug 2024 12:08:23 -0400 Subject: [PATCH 7/8] Update docs/resources/Message.md --- docs/resources/Message.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/Message.md b/docs/resources/Message.md index c080048ef3..c0767e5fcc 100644 --- a/docs/resources/Message.md +++ b/docs/resources/Message.md @@ -523,7 +523,7 @@ Certain embed types are used to power special UIs. These embeds use [fields](#DO ###### Poll Result Embed Fields -| Embed Field Name | Embed Field Value Description | +| Field | Description | |-------------------------------|------------------------------------------------------------| | poll_question_text | question text from the original poll | | victor_answer_votes | number of votes for the answer(s) with the most votes | From 3952e81b60e0f5f9bc38bf9617305727e09996cd Mon Sep 17 00:00:00 2001 From: Shay Date: Fri, 16 Aug 2024 12:09:42 -0400 Subject: [PATCH 8/8] tables --- docs/resources/Message.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/resources/Message.md b/docs/resources/Message.md index c0767e5fcc..0233d9bbf2 100644 --- a/docs/resources/Message.md +++ b/docs/resources/Message.md @@ -525,13 +525,13 @@ Certain embed types are used to power special UIs. These embeds use [fields](#DO | Field | Description | |-------------------------------|------------------------------------------------------------| -| poll_question_text | question text from the original poll | +| poll_question_text | question text from the original poll | | victor_answer_votes | number of votes for the answer(s) with the most votes | | total_votes | total number of votes in the poll | -| victor_answer_id? | id for the winning answer | -| victor_answer_text? | text for the winning answer | -| victor_answer_emoji_id? | id for an emoji associated with the winning answer | -| victor_answer_emoji_name? | name of an emoji associated with the winning answer | +| victor_answer_id? | id for the winning answer | +| victor_answer_text? | text for the winning answer | +| victor_answer_emoji_id? | id for an emoji associated with the winning answer | +| victor_answer_emoji_name? | name of an emoji associated with the winning answer | | victor_answer_emoji_animated? | if an emoji associated with the winning answer is animated | ### Attachment Object