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:
Gus Caplan
2017-03-21 02:17:20 -05:00
committed by Schuyler Cebulskie
parent 3e0c0f44a2
commit dd8907472c

View File

@@ -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 = {};