From 723e392c95bc8e9c03104a1a647870725d6d1fe0 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 24 Jun 2017 20:55:47 -0400 Subject: [PATCH] Properly sort roles and discard everyone role in Member.colour. --- discord/member.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/discord/member.py b/discord/member.py index 7b9698695..4226bffe8 100644 --- a/discord/member.py +++ b/discord/member.py @@ -238,11 +238,13 @@ class Member(discord.abc.Messageable, _BaseUser): """ default_colour = Colour.default() + roles = self.roles[1:] # remove @everyone + # highest order of the colour is the one that gets rendered. # if the highest is the default colour then the next one with a colour # is chosen instead - if self.roles: - roles = sorted(self.roles, key=lambda r: r.position, reverse=True) + if roles: + roles = sorted(roles, reverse=True) for role in roles: if role.colour == default_colour: continue