mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
fix websocket ratelimits (#2014)
This commit is contained in:
parent
af75e43900
commit
7f5c1038db
1 changed files with 4 additions and 2 deletions
|
|
@ -81,7 +81,9 @@ class WebSocketConnection extends EventEmitter {
|
|||
*/
|
||||
this.ratelimit = {
|
||||
queue: [],
|
||||
remaining: 60,
|
||||
remaining: 120,
|
||||
total: 120,
|
||||
time: 60e3,
|
||||
resetTimer: null,
|
||||
};
|
||||
this.connect(gateway);
|
||||
|
|
@ -193,7 +195,7 @@ class WebSocketConnection extends EventEmitter {
|
|||
this.ratelimit.resetTimer = this.client.setTimeout(() => {
|
||||
this.ratelimit.remaining = 60;
|
||||
this.processQueue();
|
||||
}, 120e3);
|
||||
}, this.ratelimit.time);
|
||||
}
|
||||
while (this.ratelimit.remaining > 0) {
|
||||
const item = this.ratelimit.queue.shift();
|
||||
|
|
|
|||
Loading…
Reference in a new issue