Files
discord.js/src/rest/handlers/burst.js
2018-05-14 22:55:50 -05:00

16 lines
376 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 }) => {
if (timeout) {
this.client.setTimeout(() => {
this.reset();
this.handle();
}, timeout);
}
});
this.remaining--;
this.handle();
};