Fix member hex colors with leading zeros

This commit is contained in:
Jeremy Zhang 2017-08-22 02:52:54 +00:00
parent c8d35ff265
commit a0a0f01655

View File

@ -277,6 +277,8 @@ def get_online_discord_users(guild_id, embed):
for role in mem_roles: for role in mem_roles:
if role["color"] != 0: if role["color"] != 0:
member["color"] = '{0:02x}'.format(role["color"]) #int to hex member["color"] = '{0:02x}'.format(role["color"]) #int to hex
while len(member["color"]) < 6:
member["color"] = "0" + member["color"]
if role["hoist"]: if role["hoist"]:
member["hoist-role"] = {} member["hoist-role"] = {}
member["hoist-role"]["name"] = role["name"] member["hoist-role"]["name"] = role["name"]