mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Fix role position checks (#4740)
This commit is contained in:
parent
d7a3da49f0
commit
537656c365
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user