Fix role position checks (#4740)

This commit is contained in:
jack1142 2021-01-20 21:32:43 +01:00 committed by GitHub
parent d7a3da49f0
commit 537656c365
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -10,4 +10,4 @@ async def is_allowed_by_hierarchy(
if not await config.guild(guild).respect_hierarchy():
return True
is_special = mod == guild.owner or await bot.is_owner(mod)
return mod.top_role.position > user.top_role.position or is_special
return mod.top_role > user.top_role or is_special

View File

@ -145,7 +145,7 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
self, guild: discord.Guild, mod: discord.Member, user: discord.Member
):
is_special = mod == guild.owner or await self.bot.is_owner(mod)
return mod.top_role.position > user.top_role.position or is_special
return mod.top_role > user.top_role or is_special
async def _handle_automatic_unmute(self):
"""This is the core task creator and loop

View File

@ -108,7 +108,7 @@ async def is_allowed_by_hierarchy(
if not await settings.guild(guild).respect_hierarchy():
return True
is_special = mod == guild.owner or await bot.is_owner(mod)
return mod.top_role.position > user.top_role.position or is_special
return mod.top_role > user.top_role or is_special
async def is_mod_or_superior(