diff options
| author | 2021-08-04 13:40:43 -0400 | |
|---|---|---|
| committer | 2021-08-04 18:40:43 +0100 | |
| commit | 75862768ebd4b182e713add91cf705c6fcfc70f8 (patch) | |
| tree | 4efaf75312431cf51b71cafa895fd0a2031ab4a5 | |
| parent | Suppress 403 error when sending DEFCON reject DM (#1711) (diff) | |
Reorder user roles in !user command from highest to lowest (#1719)
Reorder user roles in !user command from highest to lowest
| -rw-r--r-- | bot/exts/info/information.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py index bb713eef1..800a68821 100644 --- a/bot/exts/info/information.py +++ b/bot/exts/info/information.py @@ -243,7 +243,9 @@ class Information(Cog): if on_server: joined = discord_timestamp(user.joined_at, TimestampFormats.RELATIVE) - roles = ", ".join(role.mention for role in user.roles[1:]) + # The 0 is for excluding the default @everyone role, + # and the -1 is for reversing the order of the roles to highest to lowest in hierarchy. + roles = ", ".join(role.mention for role in user.roles[:0:-1]) membership = {"Joined": joined, "Verified": not user.pending, "Roles": roles or None} if not is_mod_channel(ctx.channel): membership.pop("Verified") |