-
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
document the poll result message and embed #7050
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ced77a3
document the poll result message and embed
anderswift 409be51
fix redundant language
anderswift 144fe78
create a new section for embed fields by embed type
anderswift 222889c
edit text
advaith1 26998d3
links
advaith1 ee95649
Update docs/resources/Message.md
shaydewael 59c3459
Update docs/resources/Message.md
shaydewael 3952e81
tables
shaydewael File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,13 @@ 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 will be mentioned. | ||
- These messages contain a [`poll_result` embed](#DOCS_RESOURCES_MESSAGE/embed-fields-by-embed-type-poll-result-embed-fields) | ||
|
||
#### Voice Messages | ||
|
||
Voice messages are messages with the `IS_VOICE_MESSAGE` flag. They have the following properties. | ||
|
@@ -420,16 +428,15 @@ 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 | | ||
| 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/embed-fields-by-embed-type-poll-result-embed-fields) | | ||
|
||
###### Embed Thumbnail Structure | ||
|
||
|
@@ -510,6 +517,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 | ||
|
||
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 Fields | ||
|
||
| Embed Field Name | Embed Field Value Description | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a "parse as" (or something like that) column could be added to indicate what the value string will look like.
shaydewael marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|-------------------------------|------------------------------------------------------------| | ||
| 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 | | ||
shaydewael marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Attachment Object | ||
|
||
###### Attachment Structure | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.