Files
discord.js/src/rest/handlers/burst.js
Gus Caplan 18e3801bb7 lots of important stuff (#1883)
* lots of important stuff

* Update Constants.js
2017-09-04 17:49:44 +02:00

14 lines
431 B
JavaScript

module.exports = function burst() {
if (this.limited || this.queue.length === 0) return;
this.execute(this.queue.shift())
.then(this.handle.bind(this))
.catch(({ timeout }) => {
this.client.setTimeout(() => {
this.reset();
this.handle();
}, timeout || (this.resetTime - Date.now() + this.timeDifference + this.client.options.restTimeOffset));
});
this.remaining--;
this.handle();
};