discord-api-docs
discord-api-docs copied to clipboard
Clarification about removal of nonce field in Channel->Create Message endpoint
Description
The nonce
field was removed from the Channel -> Create Message endpoint without any notice in following PR: #2859
The PR was not even closely related to thr nonce
field at all.
Confusing is that most libraries are still providing access to this field even it is not documented anymore.
As well does the Message object still contain the nonce
field.
Thereby I ask for clarification if the nonce
field has been deprecated or was removed from the documentation by error.
Steps to Reproduce
Check documentation for Channel -> Create Message endpoint.
Expected Behavior
nonce
being documented or stated that has been deprecated or removed from Channels->Create Message endpoint.
Current Behavior
nonce
field is not documented for Channel->Create Message endpoint anymore
Screenshots/Videos
No response
Client and System Information
Browser: Google Chrome OS: Windows 10
The nonce field is used for deduplication of messages by the client and has no effect on bot messages.
I mean there could still be a use casenfor bots. I am just asking for a proper clarification why the field is not documented any more on the Channels -> Create Message endpoint.
For example discordjs is still listing it in their API types library: https://github.com/discordjs/discord-api-types/blob/main/rest/v10/channel.ts#L215
the field is not part of our bot api. it is ignored for bots.
I think it should also be used for deduplicating messages for bots, since the same problem happens with bots. When the request results in a bad gateway error, you have no way to know whether the message went through or not and have to retry or just hope. Why would this not be done for bots?
the field is not part of our bot api. it is ignored for bots.
No it isn't.
This field is relatively useful for pairing a message received with a message sent for things like ping calculations or just other use cases where you'd want to do the pairing.
ah i meant ignored for message send deduplication, which is the reason it exists in our api. if you just want it for identifying messages that could maybe be valid (feel free to open a pr) but its worth noting that the send message endpoint returns the created message with its id already.
if you just want it for identifying messages that could maybe be valid
can nonce support be added to webhooks for this? #3396
ah i meant ignored for message send deduplication,
No way to guarantee deduplication for bots? Weird.
Looks like this field doesn't make sense for bots at the moment. Please file a separate feature request if you have a legitimate use-case for the nonce field.
Legitimate use-cases were brought up in the comments of this issue, and allegedly the nonce will be used to dedupe messages of bots on v11+.
I agree that those use-cases merit discussion, but this issue is about the documentation which is currently accurate. While the API won't error if you send a nonce, there's no purpose in doing so.
If bot support gets added for v11+ then we can document it when that happens.
I talked a bit more about this internally and it looks like we are continuing to support this without the deduplication functionality. My apologies for the confusion here, and thanks for calling it out! I'm going to leave this issue closed for now, but #5078 will be merged to fully resolve this.
has nonce support been added to webhooks for pairing? if not, can that happen?