mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 20:42:27 +00:00
Fix Hydar's lint errors
This commit is contained in:
parent
544e456302
commit
ab30715028
2 changed files with 10 additions and 5 deletions
|
|
@ -29,7 +29,9 @@ class BurstRequestHandler extends RequestHandler {
|
|||
this.requestResetTime = Number(res.headers['x-ratelimit-reset']) * 1000;
|
||||
this.requestRemaining = Number(res.headers['x-ratelimit-remaining']);
|
||||
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.status === 429) {
|
||||
|
|
|
|||
|
|
@ -76,10 +76,13 @@ class SequentialRequestHandler extends RequestHandler {
|
|||
const data = res && res.body ? res.body : {};
|
||||
item.resolve(data);
|
||||
if (this.requestRemaining === 0) {
|
||||
this.restManager.client.setTimeout(() => {
|
||||
this.waiting = false;
|
||||
resolve(data);
|
||||
}, (this.requestResetTime - Date.now()) + this.timeDifference + this.restManager.client.options.restTimeOffset);
|
||||
this.restManager.client.setTimeout(
|
||||
() => {
|
||||
this.waiting = false;
|
||||
resolve(data);
|
||||
},
|
||||
this.requestResetTime - Date.now() + this.timeDifference + this.restManager.client.options.restTimeOffset
|
||||
);
|
||||
} else {
|
||||
this.waiting = false;
|
||||
resolve(data);
|
||||
|
|
|
|||
Loading…
Reference in a new issue