mirror of https://github.com/coddrago/Heroku
Revert "remove hikari`s ubguard as redundant (err 521)"
This reverts commit f8a71f20a2
.
pull/150/head
parent
399270e59a
commit
095adc6a77
|
@ -145,6 +145,7 @@ class CommandDispatcher:
|
||||||
self.raw_handlers = []
|
self.raw_handlers = []
|
||||||
self._external_bl: typing.List[int] = []
|
self._external_bl: typing.List[int] = []
|
||||||
|
|
||||||
|
asyncio.ensure_future(self._external_bl_reload_loop())
|
||||||
|
|
||||||
async def _handle_ratelimit(self, message: Message, func: callable) -> bool:
|
async def _handle_ratelimit(self, message: Message, func: callable) -> bool:
|
||||||
if await self.security.check(message, security.OWNER):
|
if await self.security.check(message, security.OWNER):
|
||||||
|
@ -712,3 +713,15 @@ class CommandDispatcher:
|
||||||
await func(message)
|
await func(message)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
await exception_handler(e, message, *args)
|
await exception_handler(e, message, *args)
|
||||||
|
|
||||||
|
async def _external_bl_reload_loop(self):
|
||||||
|
while True:
|
||||||
|
with contextlib.suppress(Exception):
|
||||||
|
self._external_bl = (
|
||||||
|
await utils.run_sync(
|
||||||
|
requests.get,
|
||||||
|
"https://ubguard.dan.tatar/blacklist.json",
|
||||||
|
)
|
||||||
|
).json()["blacklist"]
|
||||||
|
|
||||||
|
await asyncio.sleep(60)
|
||||||
|
|
Loading…
Reference in New Issue