diff --git a/gramjs/requestIter.ts b/gramjs/requestIter.ts index b1d597f7..46147524 100644 --- a/gramjs/requestIter.ts +++ b/gramjs/requestIter.ts @@ -66,6 +66,13 @@ export class RequestIter implements AsyncIterable { this.waitTime - (new Date().getTime() / 1000 - this.lastLoad) ); + await sleep( + Math.max( + 0, + this.waitTime - + (new Date().getTime() / 1000 - this.lastLoad) + ) + ); } this.lastLoad = new Date().getTime() / 1000; this.index = 0;