From 33374e32faca181fccbfa14b1603a46ad6e5f841 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Fri, 2 Mar 2018 04:55:52 +0000 Subject: [PATCH] Sidebar discord members image to ditch jpgs --- webapp/titanembeds/blueprints/api/api.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index cfac41c..7a7a39d 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -113,6 +113,12 @@ def get_online_discord_users(guild_id, embed): member["hoist-role"]["name"] = role["name"] member["hoist-role"]["id"] = role["id"] member["hoist-role"]["position"] = role["position"] + if member.get("avatar", None): + member["avatar_url"] = "https://cdn.discordapp.com/avatars/{}/{}".format(member["id"], member["avatar"]) + if member["avatar"].startswith("a_"): + member["avatar_url"] = member["avatar_url"] + ".gif" + else: + member["avatar_url"] = member["avatar_url"] + ".png" return embed['members'] def get_online_embed_users(guild_id):