fix(text): Catch unloaded core modules.
This commit is contained in:
@@ -148,6 +148,12 @@ class TextTrackerCog(LionCog):
|
|||||||
logger.info(
|
logger.info(
|
||||||
f"Saving batch of {len(batch)} completed text sessions."
|
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
|
# Batch-fetch lguilds
|
||||||
lguilds = await self.bot.core.lions.fetch_guilds(*{session.guildid for session in batch})
|
lguilds = await self.bot.core.lions.fetch_guilds(*{session.guildid for session in batch})
|
||||||
|
|||||||
Reference in New Issue
Block a user