Browse Source

Properly sort roles and discard everyone role in Member.colour.

pull/609/merge
Rapptz 8 years ago
parent
commit
723e392c95
  1. 6
      discord/member.py

6
discord/member.py

@ -238,11 +238,13 @@ class Member(discord.abc.Messageable, _BaseUser):
""" """
default_colour = Colour.default() default_colour = Colour.default()
roles = self.roles[1:] # remove @everyone
# highest order of the colour is the one that gets rendered. # 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 # if the highest is the default colour then the next one with a colour
# is chosen instead # is chosen instead
if self.roles: if roles:
roles = sorted(self.roles, key=lambda r: r.position, reverse=True) roles = sorted(roles, reverse=True)
for role in roles: for role in roles:
if role.colour == default_colour: if role.colour == default_colour:
continue continue

Loading…
Cancel
Save