fixed webhook pfp for regular miku being wrong when evil mode active

This commit is contained in:
2026-03-05 22:16:14 +02:00
parent 832fc0d039
commit 54d9a80089

View File

@@ -263,14 +263,21 @@ def get_persona_avatar_urls() -> dict:
"""Get current avatar URLs for Miku and Evil Miku personas.
Returns a dict with 'miku' and 'evil_miku' avatar URL strings (or None).
Uses the bot's current Discord avatar for Miku (always up-to-date).
Evil Miku falls back to the webhook's stored avatar (passed as None).
When Evil Mode is inactive, uses the bot's current Discord avatar for Miku.
When Evil Mode is active, the bot account avatar has been changed to the evil
pfp, so returning None for Miku causes the webhook to fall back to its own
stored avatar (set to current.png by update_webhook_avatars), preventing
both webhooks from showing the evil pfp.
Evil Miku always falls back to the webhook's stored avatar (passed as None).
"""
miku_url = None
evil_url = None
# For Miku: use the bot's actual Discord avatar URL (always matches current pfp)
if globals.client and globals.client.user:
# For Miku: use the bot's actual Discord avatar URL only when Evil Mode is
# not active. When Evil Mode is on, the bot account avatar has been swapped
# to evil_pfp.png, so we pass None here and let the Miku webhook use its
# own correctly-stored avatar (current.png) instead.
if not globals.EVIL_MODE and globals.client and globals.client.user:
try:
miku_url = str(globals.client.user.display_avatar.url)
except Exception: