mirror of https://github.com/coddrago/Heroku
Whitelist GetChannelDifferenceRequest from api protection
parent
70d57b7cdf
commit
7d2c833635
|
@ -12,6 +12,7 @@ import random
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from hikkatl.tl import functions
|
from hikkatl.tl import functions
|
||||||
|
from hikkatl.tl.functions.updates import GetChannelDifferenceRequest
|
||||||
from hikkatl.tl.tlobject import TLRequest
|
from hikkatl.tl.tlobject import TLRequest
|
||||||
from hikkatl.tl.types import Message
|
from hikkatl.tl.types import Message
|
||||||
|
|
||||||
|
@ -600,9 +601,13 @@ class APIRatelimiterMod(loader.Module):
|
||||||
flood_sleep_threshold: int = None,
|
flood_sleep_threshold: int = None,
|
||||||
):
|
):
|
||||||
await asyncio.sleep(random.randint(1, 5) / 100)
|
await asyncio.sleep(random.randint(1, 5) / 100)
|
||||||
if time.perf_counter() > self._suspend_until and not self.get(
|
if (
|
||||||
|
time.perf_counter() > self._suspend_until
|
||||||
|
and not self.get(
|
||||||
"disable_protection",
|
"disable_protection",
|
||||||
True,
|
True,
|
||||||
|
)
|
||||||
|
and not isinstance(request, GetChannelDifferenceRequest)
|
||||||
):
|
):
|
||||||
request_name = type(request).__name__
|
request_name = type(request).__name__
|
||||||
self._ratelimiter += [[request_name, time.perf_counter()]]
|
self._ratelimiter += [[request_name, time.perf_counter()]]
|
||||||
|
|
Loading…
Reference in New Issue