Chunk all guilds on startup
This commit is contained in:
parent
5ad05b8837
commit
158591acac
1 changed files with 7 additions and 0 deletions
|
@ -82,6 +82,12 @@ class Jarvis(StatsClient):
|
|||
self.phishing_domains = []
|
||||
self.pre_run_callback = self._prerun
|
||||
|
||||
async def _chunk_all(self) -> None:
|
||||
"""Chunk all guilds."""
|
||||
for guild in self.guilds:
|
||||
self.logger.debug(f"Chunking guild {guild.name} <{guild.id}>")
|
||||
await guild.chunk_guild()
|
||||
|
||||
@Task.create(IntervalTrigger(hours=1))
|
||||
async def _update_domains(self) -> None:
|
||||
self.logger.debug("Updating phishing domains")
|
||||
|
@ -137,6 +143,7 @@ class Jarvis(StatsClient):
|
|||
try:
|
||||
await self._sync_domains()
|
||||
self._update_domains.start()
|
||||
asyncio.create_task(self._chunk_all())
|
||||
except Exception as e:
|
||||
self.logger.error("Failed to load anti-phishing", exc_info=e)
|
||||
self.logger.info("Logged in as {}".format(self.user)) # noqa: T001
|
||||
|
|
Loading…
Add table
Reference in a new issue