mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 04:52:22 +00:00
nonce has to be a uint64 :< (#1240)
* nonce me daddy * Update RESTMethods.js * Update RESTMethods.js * Update RESTMethods.js * Update RESTMethods.js * Update RESTMethods.js * Update RESTMethods.js * (╯°□°)╯︵ ┻━┻ * Update RESTMethods.js * Update RESTMethods.js
This commit is contained in:
parent
3e0c0f44a2
commit
dd8907472c
1 changed files with 6 additions and 0 deletions
|
|
@ -62,6 +62,12 @@ class RESTMethods {
|
|||
return new Promise((resolve, reject) => { // eslint-disable-line complexity
|
||||
if (typeof content !== 'undefined') content = this.client.resolver.resolveString(content);
|
||||
|
||||
// The nonce has to be a uint64 :<
|
||||
if (typeof nonce !== 'undefined') {
|
||||
nonce = parseInt(nonce);
|
||||
if (isNaN(nonce) || nonce < 0) throw new RangeError('Message nonce must fit in an unsigned 64-bit integer.');
|
||||
}
|
||||
|
||||
if (content) {
|
||||
if (split && typeof split !== 'object') split = {};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue