Skip to content

Commit

Permalink
Fix message structure notes (#5084)
Browse files Browse the repository at this point in the history
* Fix message structure notes

* Update docs/resources/Channel.md

Co-authored-by: advaith <[email protected]>

Co-authored-by: advaith <[email protected]>
  • Loading branch information
Lulalaby and advaith1 authored Jun 21, 2022
1 parent 4025fb5 commit 2b6aa7e
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions docs/resources/Channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,37 +235,37 @@ Represents a message sent in a channel within Discord.
> warn
> `content`, `embeds`, `attachments`, and `components` will require a privileged intent in 2022. [Learn more here](https://support-dev.discord.com/hc/en-us/articles/4404772028055).
| Field | Type | Description |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| id | snowflake | id of the message |
| channel_id | snowflake | id of the channel the message was sent in |
| author\* | [user](#DOCS_RESOURCES_USER/user-object) object | the author of this message (not guaranteed to be a valid user, see below) |
| content | string | contents of the message |
| timestamp | ISO8601 timestamp | when this message was sent |
| edited_timestamp | ?ISO8601 timestamp | when this message was edited (or null if never) |
| tts | boolean | whether this was a TTS message |
| mention_everyone | boolean | whether this message mentions everyone |
| mentions | array of [user](#DOCS_RESOURCES_USER/user-object) objects | users specifically mentioned in the message |
| mention_roles | array of [role](#DOCS_TOPICS_PERMISSIONS/role-object) object ids | roles specifically mentioned in this message |
| mention_channels?\*\*\* | array of [channel mention](#DOCS_RESOURCES_CHANNEL/channel-mention-object) objects | channels specifically mentioned in this message |
| attachments | array of [attachment](#DOCS_RESOURCES_CHANNEL/attachment-object) objects | any attached files |
| embeds | array of [embed](#DOCS_RESOURCES_CHANNEL/embed-object) objects | any embedded content |
| reactions? | array of [reaction](#DOCS_RESOURCES_CHANNEL/reaction-object) objects | reactions to the message |
| nonce? | integer or string | used for validating a message was sent |
| pinned | boolean | whether this message is pinned |
| webhook_id? | snowflake | if the message is generated by a webhook, this is the webhook's id |
| type | integer | [type of message](#DOCS_RESOURCES_CHANNEL/message-object-message-types) |
| activity? | [message activity](#DOCS_RESOURCES_CHANNEL/message-object-message-activity-structure) object | sent with Rich Presence-related chat embeds |
| application? | partial [application](#DOCS_RESOURCES_APPLICATION/application-object) object | sent with Rich Presence-related chat embeds |
| application_id? | snowflake | if the message is an [Interaction](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/) or application-owned webhook, this is the id of the application |
| message_reference? | [message reference](#DOCS_RESOURCES_CHANNEL/message-reference-object-message-reference-structure) object | data showing the source of a crosspost, channel follow add, pin, or reply message |
| flags? | integer | [message flags](#DOCS_RESOURCES_CHANNEL/message-object-message-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) |
| referenced_message?\*\* | ?[message object](#DOCS_RESOURCES_CHANNEL/message-object) | the message associated with the message_reference |
| interaction? | [message interaction object](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/message-interaction-object-message-interaction-structure) | sent if the message is a response to an [Interaction](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/) |
| thread? | [channel](#DOCS_RESOURCES_CHANNEL/channel-object) object | the thread that was started from this message, includes [thread member](#DOCS_RESOURCES_CHANNEL/thread-member-object) object |
| components? | Array of [message components](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object) | sent if the message contains components like buttons, action rows, or other interactive components |
| sticker_items? | array of [message sticker item objects](#DOCS_RESOURCES_STICKER/sticker-item-object) | sent if the message contains stickers |
| stickers? | array of [sticker](#DOCS_RESOURCES_STICKER/sticker-object) objects | **Deprecated** the stickers sent with the message |
| Field | Type | Description |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| id | snowflake | id of the message |
| channel_id | snowflake | id of the channel the message was sent in |
| author\* | [user](#DOCS_RESOURCES_USER/user-object) object | the author of this message (not guaranteed to be a valid user, see below) |
| content | string | contents of the message |
| timestamp | ISO8601 timestamp | when this message was sent |
| edited_timestamp | ?ISO8601 timestamp | when this message was edited (or null if never) |
| tts | boolean | whether this was a TTS message |
| mention_everyone | boolean | whether this message mentions everyone |
| mentions | array of [user](#DOCS_RESOURCES_USER/user-object) objects | users specifically mentioned in the message |
| mention_roles | array of [role](#DOCS_TOPICS_PERMISSIONS/role-object) object ids | roles specifically mentioned in this message |
| mention_channels?\*\* | array of [channel mention](#DOCS_RESOURCES_CHANNEL/channel-mention-object) objects | channels specifically mentioned in this message |
| attachments | array of [attachment](#DOCS_RESOURCES_CHANNEL/attachment-object) objects | any attached files |
| embeds | array of [embed](#DOCS_RESOURCES_CHANNEL/embed-object) objects | any embedded content |
| reactions? | array of [reaction](#DOCS_RESOURCES_CHANNEL/reaction-object) objects | reactions to the message |
| nonce? | integer or string | used for validating a message was sent |
| pinned | boolean | whether this message is pinned |
| webhook_id? | snowflake | if the message is generated by a webhook, this is the webhook's id |
| type | integer | [type of message](#DOCS_RESOURCES_CHANNEL/message-object-message-types) |
| activity? | [message activity](#DOCS_RESOURCES_CHANNEL/message-object-message-activity-structure) object | sent with Rich Presence-related chat embeds |
| application? | partial [application](#DOCS_RESOURCES_APPLICATION/application-object) object | sent with Rich Presence-related chat embeds |
| application_id? | snowflake | if the message is an [Interaction](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/) or application-owned webhook, this is the id of the application |
| message_reference? | [message reference](#DOCS_RESOURCES_CHANNEL/message-reference-object-message-reference-structure) object | data showing the source of a crosspost, channel follow add, pin, or reply message |
| flags? | integer | [message flags](#DOCS_RESOURCES_CHANNEL/message-object-message-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) |
| referenced_message?\*\*\* | ?[message object](#DOCS_RESOURCES_CHANNEL/message-object) | the message associated with the message_reference |
| interaction? | [message interaction object](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/message-interaction-object-message-interaction-structure) | sent if the message is a response to an [Interaction](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/) |
| thread? | [channel](#DOCS_RESOURCES_CHANNEL/channel-object) object | the thread that was started from this message, includes [thread member](#DOCS_RESOURCES_CHANNEL/thread-member-object) object |
| components? | Array of [message components](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object) | sent if the message contains components like buttons, action rows, or other interactive components |
| sticker_items? | array of [message sticker item objects](#DOCS_RESOURCES_STICKER/sticker-item-object) | sent if the message contains stickers |
| stickers? | array of [sticker](#DOCS_RESOURCES_STICKER/sticker-object) objects | **Deprecated** the stickers sent with the message |

\* 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.

Expand Down

0 comments on commit 2b6aa7e

Please sign in to comment.