mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
16 lines
376 B
JavaScript
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();
|
|
};
|