hotfix if the membr has a role that does not exist somehow

This commit is contained in:
Jeremy Zhang 2017-07-28 05:30:59 +00:00
parent 33f881bff3
commit e6624e0185

View File

@ -259,7 +259,9 @@ def get_online_discord_users(guild_id, embed):
member["color"] = None member["color"] = None
if apimem: if apimem:
for roleid in reversed(apimem["roles"]): for roleid in reversed(apimem["roles"]):
role = guildroles_filtered[roleid] role = guildroles_filtered.get(roleid)
if not role:
continue
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
if role["hoist"]: if role["hoist"]: