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

@@ -1230,11 +1230,17 @@ async def manual_send_webhook(
for file_info in file_data:
discord_files.append(discord.File(io.BytesIO(file_info['content']), filename=file_info['filename']))
# Send via webhook with display name
# Get current avatar URL for the persona
from utils.bipolar_mode import get_persona_avatar_urls
avatar_urls = get_persona_avatar_urls()
avatar_url = avatar_urls.get("evil_miku") if persona == "evil" else avatar_urls.get("miku")
# Send via webhook with display name and current avatar
if discord_files:
await webhook.send(
content=message,
username=display_name,
avatar_url=avatar_url,
files=discord_files,
wait=True
)
@@ -1242,6 +1248,7 @@ async def manual_send_webhook(
await webhook.send(
content=message,
username=display_name,
avatar_url=avatar_url,
wait=True
)