This commit is contained in:
Slipstream 2025-04-26 08:16:42 -06:00
parent a7400a79d3
commit a47cf764e6
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD
2 changed files with 9 additions and 10 deletions

View File

@ -4133,9 +4133,7 @@ Otherwise, STAY SILENT. Do not respond just to be present or because you *can*.
# --- Decide if we should even CONSIDER responding (call the AI) ---
should_consider_responding = False
consideration_reason = "Default"
# Initialize proactive_trigger_met variable
proactive_trigger_met = False
proactive_trigger_met = False # Initialize proactive_trigger_met variable before it's used
# Always consider if mentioned, replied to, or name used directly
if bot_mentioned or replied_to_bot or gurt_in_message:

View File

@ -29,11 +29,7 @@ class ProfileUpdaterCog(commands.Cog):
async def cog_load(self):
"""Initialize resources when the cog is loaded."""
self.session = aiohttp.ClientSession()
# Wait until the bot is ready to get other cogs
await self.bot.wait_until_ready()
self.gurt_cog = self.bot.get_cog('GurtCog')
if not self.gurt_cog:
print("ERROR: ProfileUpdaterCog could not find GurtCog. AI features will not work.")
# Removed wait_until_ready and gurt_cog retrieval from here
if not self.bot_token:
print("WARNING: BOT_TOKEN environment variable not set. Bio updates will fail.")
print(f"ProfileUpdaterCog loaded. Update interval: {self.update_interval_hours} hours.")
@ -58,9 +54,14 @@ class ProfileUpdaterCog(commands.Cog):
@profile_update_task.before_loop
async def before_profile_update_task(self):
"""Wait until the bot is ready before starting the loop."""
"""Wait until the bot is ready and get GurtCog before starting the loop."""
await self.bot.wait_until_ready()
print("ProfileUpdaterTask: Bot ready, starting loop.")
print("ProfileUpdaterTask: Bot ready, attempting to get GurtCog...")
self.gurt_cog = self.bot.get_cog('GurtCog')
if not self.gurt_cog:
print("ERROR: ProfileUpdaterTask could not find GurtCog after bot is ready. AI features will not work.")
else:
print("ProfileUpdaterTask: GurtCog found. Starting loop.")
async def perform_update_cycle(self):
"""Performs a single profile update check and potential update."""