mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
lots of important stuff (#1883)
* lots of important stuff * Update Constants.js
This commit is contained in:
13
src/rest/handlers/burst.js
Normal file
13
src/rest/handlers/burst.js
Normal file
@@ -0,0 +1,13 @@
|
||||
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();
|
||||
};
|
||||
Reference in New Issue
Block a user