Sidebar discord members image to ditch jpgs

This commit is contained in:
Jeremy Zhang 2018-03-02 04:55:52 +00:00
parent 9ddb4552fe
commit 33374e32fa

View File

@ -113,6 +113,12 @@ def get_online_discord_users(guild_id, embed):
member["hoist-role"]["name"] = role["name"] member["hoist-role"]["name"] = role["name"]
member["hoist-role"]["id"] = role["id"] member["hoist-role"]["id"] = role["id"]
member["hoist-role"]["position"] = role["position"] 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'] return embed['members']
def get_online_embed_users(guild_id): def get_online_embed_users(guild_id):