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
When using this, currently developers have to specify both a random nonce and enforceNonce: true either in every <BaseChannel>.send() function in the payload, or extend the class(es) themselves to handle it everywhere.
Ideal solution or implementation
A client option, disabled by default, to automatically generate a nonce (e.g. using SnowflakeUtil.generate().toString()) and set both nonce and (while it's still required) enforceNonce when creating a Message, unless one or both of those parameters are already present in the payload.
Alternative solutions or implementations
A Message payload parameter like sendNonce which does the same as above, but it's per Message instead of globally.
Which application or package is this feature request for?
discord.js
Feature
Discord recently added support for enforcing the nonce parameter when creating a Message, to be able to prevent duplicate messages in a short amount of time.
When using this, currently developers have to specify both a random
nonce
andenforceNonce: true
either in every<BaseChannel>.send()
function in the payload, or extend the class(es) themselves to handle it everywhere.Ideal solution or implementation
A client option, disabled by default, to automatically generate a nonce (e.g. using
SnowflakeUtil.generate().toString()
) and set bothnonce
and (while it's still required)enforceNonce
when creating a Message, unless one or both of those parameters are already present in the payload.Alternative solutions or implementations
A Message payload parameter like
sendNonce
which does the same as above, but it's per Message instead of globally.Other context
See #10301 for why this could be useful.
The text was updated successfully, but these errors were encountered: