From f16dd460ecb33ace76e30dc3c8c55cd6ef90fb8f Mon Sep 17 00:00:00 2001 From: Ske Date: Fri, 13 Jul 2018 22:07:52 +0200 Subject: [PATCH] Fix proxying messages with no avatar set --- bot/pluralkit/proxy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/pluralkit/proxy.py b/bot/pluralkit/proxy.py index 3fc5faea..2741ddbf 100644 --- a/bot/pluralkit/proxy.py +++ b/bot/pluralkit/proxy.py @@ -63,7 +63,8 @@ async def send_hook_message(member, hook_id, hook_token, text=None, image_url=No # Use FormData because the API doesn't like JSON requests with file data fd = aiohttp.FormData() fd.add_field("username", "{} {}".format(member["name"], member["tag"] or "").strip()) - fd.add_field("avatar_url", member["avatar_url"]) + if member["avatar_url"]: + fd.add_field("avatar_url", member["avatar_url"]) if text: fd.add_field("content", text)