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
[message_create] Document new enforce_nonce param (discord#6647)
Recently I added a new enforce_nonce on POST channel/messages parameter that will allow bots to opt in to having their messages deduped on the nonce parameter in a short duration.
Copy file name to clipboardExpand all lines: docs/Change_Log.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,11 @@
1
1
# Change Log
2
2
3
+
## Enforced Nonces on Create Message Endpoint
4
+
5
+
#### February 12, 2024
6
+
7
+
The [Create message](#DOCS_RESOURCES_CHANNEL/create-message) endpoint now supports an `enforce_nonce` parameter. When set to true, the message will be deduped for the same sender within a few minutes. If a message was created with the same nonce, no new message will be created and the previous message will be returned instead. This behavior will become the default for this endpoint in a future API version.
| nonce? | integer or string | Can be used to verify a message was sent (up to 25 characters). Value will appear in the [Message Create event](#DOCS_TOPICS_GATEWAY_EVENTS/message-create). |
1060
-
| tts? | boolean |`true` if this is a TTS message |
1061
-
| embeds?\*| array of [embed](#DOCS_RESOURCES_CHANNEL/embed-object) objects | Up to 10 `rich` embeds (up to 6000 characters) |
1062
-
| allowed_mentions? |[allowed mention object](#DOCS_RESOURCES_CHANNEL/allowed-mentions-object)| Allowed mentions for the message |
1063
-
| message_reference? |[message reference](#DOCS_RESOURCES_CHANNEL/message-reference-object-message-reference-structure)| Include to make your message a reply |
1064
-
| components?\*| array of [message component](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object) objects | Components to include with the message |
1065
-
| sticker_ids?\*| array of snowflakes | IDs of up to 3 [stickers](#DOCS_RESOURCES_STICKER/sticker-object) in the server to send in the message |
1066
-
| files[n]?\*| file contents | Contents of the file being sent. See [Uploading Files](#DOCS_REFERENCE/uploading-files)|
1067
-
| payload_json? | string | JSON-encoded body of non-file params, only for `multipart/form-data` requests. See [Uploading Files](#DOCS_REFERENCE/uploading-files)|
1068
-
| attachments? | array of partial [attachment](#DOCS_RESOURCES_CHANNEL/attachment-object) objects | Attachment objects with filename and description. See [Uploading Files](#DOCS_REFERENCE/uploading-files)|
1069
-
| flags? | integer |[Message flags](#DOCS_RESOURCES_CHANNEL/message-object-message-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) (only `SUPPRESS_EMBEDS` and `SUPPRESS_NOTIFICATIONS` can be set) |
| nonce? | integer or string | Can be used to verify a message was sent (up to 25 characters). Value will appear in the [Message Create event](#DOCS_TOPICS_GATEWAY_EVENTS/message-create). |
1060
+
| tts? | boolean |`true` if this is a TTS message |
1061
+
| embeds?\*| array of [embed](#DOCS_RESOURCES_CHANNEL/embed-object) objects | Up to 10 `rich` embeds (up to 6000 characters) |
1062
+
| allowed_mentions? |[allowed mention object](#DOCS_RESOURCES_CHANNEL/allowed-mentions-object)| Allowed mentions for the message |
1063
+
| message_reference? |[message reference](#DOCS_RESOURCES_CHANNEL/message-reference-object-message-reference-structure)| Include to make your message a reply |
1064
+
| components?\*| array of [message component](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object) objects | Components to include with the message |
1065
+
| sticker_ids?\*| array of snowflakes | IDs of up to 3 [stickers](#DOCS_RESOURCES_STICKER/sticker-object) in the server to send in the message |
1066
+
| files[n]?\*| file contents | Contents of the file being sent. See [Uploading Files](#DOCS_REFERENCE/uploading-files)|
1067
+
| payload_json? | string | JSON-encoded body of non-file params, only for `multipart/form-data` requests. See [Uploading Files](#DOCS_REFERENCE/uploading-files)|
1068
+
| attachments? | array of partial [attachment](#DOCS_RESOURCES_CHANNEL/attachment-object) objects | Attachment objects with filename and description. See [Uploading Files](#DOCS_REFERENCE/uploading-files |
1069
+
| flags? | integer |[Message flags](#DOCS_RESOURCES_CHANNEL/message-object-message-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) (only `SUPPRESS_EMBEDS` and `SUPPRESS_NOTIFICATIONS` can be set) |
1070
+
| 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. |
1070
1071
1071
1072
\* At least one of `content`, `embeds`, `sticker_ids`, `components`, or `files[n]` is required.
0 commit comments