diff options
| author | Rapptz <[email protected]> | 2021-05-28 08:41:45 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-05-28 08:41:45 -0400 |
| commit | 35bef7af38aaf0e7b319da8a243d4c3deb3b0ab2 (patch) | |
| tree | daa2ce444d141be7465daf070a1c4451ec294247 /discord/role.py | |
| parent | Remove __slots__ from View (diff) | |
| download | discord.py-35bef7af38aaf0e7b319da8a243d4c3deb3b0ab2.tar.xz discord.py-35bef7af38aaf0e7b319da8a243d4c3deb3b0ab2.zip | |
Fix Role.is_assignable() computing Guild.me twice
Diffstat (limited to 'discord/role.py')
| -rw-r--r-- | discord/role.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/discord/role.py b/discord/role.py index 381aecf0..0d5c8bcd 100644 --- a/discord/role.py +++ b/discord/role.py @@ -263,7 +263,12 @@ class Role(Hashable): .. versionadded:: 2.0 """ - return not self.is_default() and not self.managed and (self.guild.me.top_role > self or self.guild.me == self.guild.owner) + me = self.guild.me + return ( + not self.is_default() + and not self.managed + and (me.top_role > self or me.id == self.guild.owner_id) + ) @property def permissions(self): |