fix(text): Catch unloaded core modules.

This commit is contained in:
2023-10-01 13:54:23 +03:00
parent 07ad2d0830
commit 5cb391eab3

View File

@@ -148,6 +148,12 @@ class TextTrackerCog(LionCog):
logger.info(
f"Saving batch of {len(batch)} completed text sessions."
)
if self.bot.core is None or self.bot.core.lions is None:
# Currently unloading, nothing we can do
logger.warning(
"Skipping text session batch due to unloaded modules."
)
return
# Batch-fetch lguilds
lguilds = await self.bot.core.lions.fetch_guilds(*{session.guildid for session in batch})