From a4ac8a0fc4f187a23f823db956c87364805d8e35 Mon Sep 17 00:00:00 2001 From: Sacul Date: Sat, 18 Oct 2025 19:24:16 +0800 Subject: [PATCH 1/5] Clarify edit message permissions and flag requirements --- docs/resources/message.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/resources/message.mdx b/docs/resources/message.mdx index 4bc2908256..5278ebeb01 100644 --- a/docs/resources/message.mdx +++ b/docs/resources/message.mdx @@ -916,7 +916,7 @@ The `emoji` must be [URL Encoded](https://en.wikipedia.org/wiki/Percent-encoding ## Edit Message /channels/[\{channel.id\}](/docs/resources/channel#channel-object)/messages/[\{message.id\}](/docs/resources/message#message-object) -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). +Edit a previously sent message. The fields `content`, `embeds`, `flags` and `components` can only 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). 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. @@ -946,7 +946,7 @@ All parameters to this endpoint are optional and nullable. | payload_json | string | JSON-encoded body of non-file params (multipart/form-data only). See [Uploading Files](/docs/reference#uploading-files) | | 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) | -\* 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`, or `poll` fields must have their values reset to empty. For `content` and `poll` this is `null`. For `embeds` and `sticker_ids` this is `[]`. Failing to do this will result in a 400 BAD REQUEST response. +\* 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`, `attachments` fields must have their values reset to empty. For `content` this is `null`. For `embeds` and `attachments` this is `[]`. Messages with a poll or those with the `sticker_ids` field set cannot be reset or edited, therefore the `IS_COMPONENTS_V2` flag cannot be set. Failing to do this will result in a 400 BAD REQUEST response. ## Delete Message /channels/[\{channel.id\}](/docs/resources/channel#channel-object)/messages/[\{message.id\}](/docs/resources/message#message-object) From 45de44d15b333373b66ab4acf4ead74c6e0dbd52 Mon Sep 17 00:00:00 2001 From: Sacul Date: Sat, 18 Oct 2025 19:36:26 +0800 Subject: [PATCH 2/5] Update IS_COMPONENTS_V2 flag documentation Clarified requirements for IS_COMPONENTS_V2 flag usage. --- docs/resources/message.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/message.mdx b/docs/resources/message.mdx index 5278ebeb01..ae1c27eb4e 100644 --- a/docs/resources/message.mdx +++ b/docs/resources/message.mdx @@ -946,7 +946,7 @@ All parameters to this endpoint are optional and nullable. | payload_json | string | JSON-encoded body of non-file params (multipart/form-data only). See [Uploading Files](/docs/reference#uploading-files) | | 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) | -\* 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`, `attachments` fields must have their values reset to empty. For `content` this is `null`. For `embeds` and `attachments` this is `[]`. Messages with a poll or those with the `sticker_ids` field set cannot be reset or edited, therefore the `IS_COMPONENTS_V2` flag cannot be set. Failing to do this will result in a 400 BAD REQUEST response. +\* 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, the `sticker_ids` and `polls` fields must be originally empty as they cannot be edited or reset and any of the used `content`, `embeds` or `attachments` fields must have their values reset to empty. For `content` and `poll` this is `null`. For `embeds`, `sticker_ids` and `attachments` this is `[]`. Failing to do this will result in a 400 BAD REQUEST response. ## Delete Message /channels/[\{channel.id\}](/docs/resources/channel#channel-object)/messages/[\{message.id\}](/docs/resources/message#message-object) From 4f58a74020e79789effb29e08d3bd0b5947dd827 Mon Sep 17 00:00:00 2001 From: Sacul Date: Sat, 18 Oct 2025 19:38:06 +0800 Subject: [PATCH 3/5] Fix wording --- docs/resources/message.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/message.mdx b/docs/resources/message.mdx index ae1c27eb4e..77507288f2 100644 --- a/docs/resources/message.mdx +++ b/docs/resources/message.mdx @@ -946,7 +946,7 @@ All parameters to this endpoint are optional and nullable. | payload_json | string | JSON-encoded body of non-file params (multipart/form-data only). See [Uploading Files](/docs/reference#uploading-files) | | 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) | -\* 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, the `sticker_ids` and `polls` fields must be originally empty as they cannot be edited or reset and any of the used `content`, `embeds` or `attachments` fields must have their values reset to empty. For `content` and `poll` this is `null`. For `embeds`, `sticker_ids` and `attachments` this is `[]`. Failing to do this will result in a 400 BAD REQUEST response. +\* 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, the `sticker_ids` and `polls` fields must originally be empty as they cannot be edited or reset and any of the used `content`, `embeds` or `attachments` fields must have their values reset to empty. For `content` and `poll` this is `null`. For `embeds`, `sticker_ids` and `attachments` this is `[]`. Failing to do this will result in a 400 BAD REQUEST response. ## Delete Message /channels/[\{channel.id\}](/docs/resources/channel#channel-object)/messages/[\{message.id\}](/docs/resources/message#message-object) From 34b7e6ba4a69c0cef225cdcd384d1057291af5b4 Mon Sep 17 00:00:00 2001 From: Sacul Date: Sat, 18 Oct 2025 20:29:31 +0800 Subject: [PATCH 4/5] Update docs/resources/message.mdx Co-authored-by: Suspense <64612795+AlmostSuspense@users.noreply.github.com> --- docs/resources/message.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/message.mdx b/docs/resources/message.mdx index 77507288f2..c76303ec62 100644 --- a/docs/resources/message.mdx +++ b/docs/resources/message.mdx @@ -916,7 +916,7 @@ The `emoji` must be [URL Encoded](https://en.wikipedia.org/wiki/Percent-encoding ## Edit Message /channels/[\{channel.id\}](/docs/resources/channel#channel-object)/messages/[\{message.id\}](/docs/resources/message#message-object) -Edit a previously sent message. The fields `content`, `embeds`, `flags` and `components` can only 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). +Edit a previously sent message. The `content`, `embeds`, and `components` fields can only 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). 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. From 6ac3351aa9ba184e21f177cd8aec6bffee5271ca Mon Sep 17 00:00:00 2001 From: Sacul Date: Sat, 18 Oct 2025 20:33:23 +0800 Subject: [PATCH 5/5] Remove comma --- docs/resources/message.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/message.mdx b/docs/resources/message.mdx index c76303ec62..e56c28ebef 100644 --- a/docs/resources/message.mdx +++ b/docs/resources/message.mdx @@ -916,7 +916,7 @@ The `emoji` must be [URL Encoded](https://en.wikipedia.org/wiki/Percent-encoding ## Edit Message /channels/[\{channel.id\}](/docs/resources/channel#channel-object)/messages/[\{message.id\}](/docs/resources/message#message-object) -Edit a previously sent message. The `content`, `embeds`, and `components` fields can only 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). +Edit a previously sent message. The `content`, `embeds` and `components` fields can only 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). 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.