diff options
| author | Rapptz <[email protected]> | 2018-09-24 20:19:47 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2018-09-24 20:19:47 -0400 |
| commit | 12cb0743168b4d4af74a7906fd636ecce651ea64 (patch) | |
| tree | 1c69d435b6144c2fb3b5797c966cba8b15ed4e17 | |
| parent | [commands] Fix up Greedy documentation a bit. (diff) | |
| download | discord.py-12cb0743168b4d4af74a7906fd636ecce651ea64.tar.xz discord.py-12cb0743168b4d4af74a7906fd636ecce651ea64.zip | |
Take the default role property into account when comparing roles.
| -rw-r--r-- | discord/role.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/discord/role.py b/discord/role.py index e134667b..086d5e55 100644 --- a/discord/role.py +++ b/discord/role.py @@ -113,6 +113,12 @@ class Role(Hashable): if self.guild != other.guild: raise RuntimeError('cannot compare roles from two different guilds.') + # the @everyone role is always the lowest role in hierarchy + guild_id = self.guild.id + if self.id == guild_id: + # everyone_role < everyone_role -> False + return other.id != guild_id + if self.position < other.position: return True |