mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01: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:
committed by
Schuyler Cebulskie
parent
3e0c0f44a2
commit
dd8907472c
@@ -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 = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user