1
0
Fork 0
mirror of synced 2024-06-17 01:54:35 +12:00

Handle if there are no roles

This commit is contained in:
phxntxm 2017-11-08 11:01:02 -06:00
parent 8adde44fb1
commit 5a28951eb7

View file

@ -117,6 +117,8 @@ class Stats:
roles = sorted([x for x in user.roles if not x.is_default()], reverse=True) roles = sorted([x for x in user.roles if not x.is_default()], reverse=True)
# I only want the top 5 roles for this purpose # I only want the top 5 roles for this purpose
roles = ", ".join("{}".format(x.name) for x in roles[:5]) roles = ", ".join("{}".format(x.name) for x in roles[:5])
# If there are no roles, then just say this
roles = roles or "No roles added"
embed.add_field(name='Top 5 roles', value=roles, inline=False) embed.add_field(name='Top 5 roles', value=roles, inline=False)
if user.game: if user.game: