From 5a28951eb7cdb94c68016fd1bd1bbeec5d8f0caf Mon Sep 17 00:00:00 2001 From: phxntxm Date: Wed, 8 Nov 2017 11:01:02 -0600 Subject: [PATCH] Handle if there are no roles --- cogs/stats.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cogs/stats.py b/cogs/stats.py index 66040bc..b3ed485 100644 --- a/cogs/stats.py +++ b/cogs/stats.py @@ -117,6 +117,8 @@ class Stats: 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 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) if user.game: