From a0a0f01655b3d21023b1063bcf8bd7baac6d14f2 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Tue, 22 Aug 2017 02:52:54 +0000 Subject: [PATCH] Fix member hex colors with leading zeros --- webapp/titanembeds/blueprints/api/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index 633148b..a833601 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -277,6 +277,8 @@ def get_online_discord_users(guild_id, embed): for role in mem_roles: if role["color"] != 0: member["color"] = '{0:02x}'.format(role["color"]) #int to hex + while len(member["color"]) < 6: + member["color"] = "0" + member["color"] if role["hoist"]: member["hoist-role"] = {} member["hoist-role"]["name"] = role["name"]