Fix webhook avatar mismatch: pass avatar_url at send time

- Fixed missing client parameter in animated GIF webhook update path
- Added get_persona_avatar_urls() helper that returns bot's current Discord
  avatar URL for Miku persona (always fresh, no cache lag)
- Pass avatar_url on every webhook.send() call in bipolar_mode.py,
  persona_dialogue.py, and api.py so avatars always match current pfp
  regardless of webhook cache state
This commit is contained in:
2026-02-25 13:20:18 +02:00
parent 9b74acd03b
commit 0edf1ef1c0
4 changed files with 55 additions and 13 deletions

View File

@@ -442,10 +442,13 @@ class ProfilePictureManager:
# Update bipolar webhook avatars if bipolar mode is active
if globals.BIPOLAR_MODE:
from bot.utils.bipolar_mode import update_webhook_avatars
updated = await update_webhook_avatars()
if debug:
logger.info(f"Updated bipolar webhook avatars: {updated}")
try:
from utils.bipolar_mode import update_webhook_avatars
updated = await update_webhook_avatars(globals.client)
if debug:
logger.info(f"Updated bipolar webhook avatars: {updated}")
except Exception as e:
logger.warning(f"Failed to update bipolar webhook avatars: {e}")
return result