mirror of
https://github.com/danbulant/discord.js
synced 2026-06-24 17:21:59 +00:00
Webpack build: ab30715028
This commit is contained in:
parent
ef2ec573ec
commit
bac682d013
1 changed files with 10 additions and 5 deletions
|
|
@ -21225,7 +21225,9 @@ class BurstRequestHandler extends RequestHandler {
|
||||||
this.requestResetTime = Number(res.headers['x-ratelimit-reset']) * 1000;
|
this.requestResetTime = Number(res.headers['x-ratelimit-reset']) * 1000;
|
||||||
this.requestRemaining = Number(res.headers['x-ratelimit-remaining']);
|
this.requestRemaining = Number(res.headers['x-ratelimit-remaining']);
|
||||||
this.timeDifference = Date.now() - new Date(res.headers.date).getTime();
|
this.timeDifference = Date.now() - new Date(res.headers.date).getTime();
|
||||||
this.handleNext((this.requestResetTime - Date.now()) + this.timeDifference + this.restManager.client.options.restTimeOffset);
|
this.handleNext(
|
||||||
|
this.requestResetTime - Date.now() + this.timeDifference + this.restManager.client.options.restTimeOffset
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err.status === 429) {
|
if (err.status === 429) {
|
||||||
|
|
@ -21348,10 +21350,13 @@ class SequentialRequestHandler extends RequestHandler {
|
||||||
const data = res && res.body ? res.body : {};
|
const data = res && res.body ? res.body : {};
|
||||||
item.resolve(data);
|
item.resolve(data);
|
||||||
if (this.requestRemaining === 0) {
|
if (this.requestRemaining === 0) {
|
||||||
this.restManager.client.setTimeout(() => {
|
this.restManager.client.setTimeout(
|
||||||
this.waiting = false;
|
() => {
|
||||||
resolve(data);
|
this.waiting = false;
|
||||||
}, (this.requestResetTime - Date.now()) + this.timeDifference + this.restManager.client.options.restTimeOffset);
|
resolve(data);
|
||||||
|
},
|
||||||
|
this.requestResetTime - Date.now() + this.timeDifference + this.restManager.client.options.restTimeOffset
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.waiting = false;
|
this.waiting = false;
|
||||||
resolve(data);
|
resolve(data);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue