You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/resources/message.mdx
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -806,12 +806,14 @@ When creating a message, apps must provide a value for **at least one of** `cont
806
806
| files[n]?\*| file contents | Contents of the file being sent. See [Uploading Files](/docs/reference#uploading-files)|
807
807
| payload_json? | string | JSON-encoded body of non-file params, only for `multipart/form-data` requests. See [Uploading Files](/docs/reference#uploading-files)|
808
808
| attachments? | array of partial [attachment](/docs/resources/message#attachment-object) objects | Attachment objects with filename and description. See [Uploading Files](/docs/reference#uploading-files)|
809
-
| flags? | integer |[Message flags](/docs/resources/message#message-object-message-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) (only `SUPPRESS_EMBEDS`and `SUPPRESS_NOTIFICATIONS` can be set) |
809
+
| flags?\*\*| integer |[Message flags](/docs/resources/message#message-object-message-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) (only `SUPPRESS_EMBEDS`, `SUPPRESS_NOTIFICATIONS`and `IS_COMPONENTS_V2` can be set) |
810
810
| enforce_nonce? | boolean | If true and nonce is present, it will be checked for uniqueness in the past few minutes. If another message was created by the same author with the same nonce, that message will be returned and no new message will be created. |
811
811
| poll? |[poll](/docs/resources/poll#poll-create-request-object) request object | A poll! |
812
812
813
813
\* At least one of `content`, `embeds`, `sticker_ids`, `components`, `files[n]`, or `poll` is required.
814
814
815
+
\*\* When the flag `IS_COMPONENTS_V2` is set, the message can only contain `components`. Providing `content`, `embeds`, `sticker_ids`, `files[n]`, or `poll` will fail with a 400 BAD REQUEST response.
816
+
815
817
###### Example Request Body (application/json)
816
818
817
819
```json
@@ -887,9 +889,9 @@ The `emoji` must be [URL Encoded](https://en.wikipedia.org/wiki/Percent-encoding
Edit a previously sent message. The fields `content`, `embeds`, and `flags` can be edited by the original message author. Other users can only edit `flags` and only if they have the `MANAGE_MESSAGES` permission in the corresponding channel. When specifying flags, ensure to include all previously set flags/bits in addition to ones that you are modifying. Only `flags` documented in the table below may be modified by users (unsupported flag changes are currently ignored without error).
892
+
Edit a previously sent message. The fields `content`, `embeds`, `flags`and `components` can be edited by the original message author. Other users can only edit `flags` and only if they have the `MANAGE_MESSAGES` permission in the corresponding channel. When specifying flags, ensure to include all previously set flags/bits in addition to ones that you are modifying. Only `flags` documented in the table below may be modified by users (unsupported flag changes are currently ignored without error).
891
893
892
-
When the `content` field is edited, the `mentions`array in the message object will be reconstructed from scratch based on the new content. The `allowed_mentions` field of the edit request controls how this happens. If there is no explicit `allowed_mentions` in the edit request, the content will be parsed with _default_ allowances, that is, without regard to whether or not an `allowed_mentions` was present in the request that originally created the message.
894
+
When the `content` field is edited, the arrays `mentions`and `mention_roles` and the boolean `mention_everyone`in the message object will be reconstructed from scratch based on the new content. When the message flag `IS_COMPONENTS_V2` is set, the reconstructed arrays and boolean are based on the edited content in the `components` array. The `allowed_mentions` field of the edit request controls how this happens. If there is no explicit `allowed_mentions` in the edit request, the content will be parsed with _default_ allowances, that is, without regard to whether or not an `allowed_mentions` was present in the request that originally created the message.
893
895
894
896
Returns a [message](/docs/resources/message#message-object) object. Fires a [Message Update](/docs/events/gateway-events#message-update) Gateway event.
895
897
@@ -910,13 +912,15 @@ All parameters to this endpoint are optional and nullable.
| embeds | array of [embed](/docs/resources/message#embed-object) objects | Up to 10 `rich` embeds (up to 6000 characters) |
913
-
| flags | integer | Edit the [flags](/docs/resources/message#message-object-message-flags) of a message (only `SUPPRESS_EMBEDS`can currently be set/unset)|
915
+
| flags | integer | Edit the [flags](/docs/resources/message#message-object-message-flags) of a message (`SUPPRESS_EMBEDS`and `IS_COMPONENTS_V2` only)\*\*|
914
916
| allowed_mentions |[allowed mention object](/docs/resources/message#allowed-mentions-object)| Allowed mentions for the message |
915
917
| components | array of [message component](/docs/components/reference#component-object)| Components to include with the message |
916
918
| files[n]| file contents | Contents of the file being sent/edited. See [Uploading Files](/docs/reference#uploading-files)|
917
919
| payload_json | string | JSON-encoded body of non-file params (multipart/form-data only). See [Uploading Files](/docs/reference#uploading-files)|
918
920
| attachments | array of [attachment](/docs/resources/message#attachment-object) objects | Attached files to keep and possible descriptions for new files. See [Uploading Files](/docs/reference#uploading-files)|
919
921
922
+
\*\* The `SUPPRESS_EMBEDS` flag can be both set and unset, while the `IS_COMPONENTS_V2` flag can only be set. When the `IS_COMPONENTS_V2` flag is set, any of the used `content`, `embeds`, `sticker_ids`, `files[n]`, or `poll` values in the initial message must be set to `null` first, otherwise it will fail with a 400 BAD REQUEST response.
0 commit comments