fix(aurora): don't try and use the attribute of a Member object when the object is a User object
All checks were successful
Actions / Build Documentation (MkDocs) (pull_request) Successful in 29s
Actions / Lint Code (Ruff & Pylint) (pull_request) Successful in 51s

This commit is contained in:
Seaswimmer 2024-08-24 19:13:01 -04:00
parent 5934506c8a
commit d600a10729
Signed by: cswimr
GPG key ID: 3813315477F26F82
2 changed files with 7 additions and 7 deletions

View file

@ -46,7 +46,7 @@ class Aurora(commands.Cog):
This cog stores all of its data in an SQLite database."""
__author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"]
__version__ = "3.0.0-indev24"
__version__ = "3.0.0-indev25"
__git__ = "https://www.coastalcommits.com/cswimr/SeaCogs"
__documentation__ = "https://seacogs.coastalcommits.com/aurora/"

View file

@ -84,12 +84,6 @@ async def check_moddable(
)
return False
if target.guild_permissions.administrator:
await ctx.send(
content="You cannot moderate members with the Administrator permission!", ephemeral=True
)
return False
if isinstance(target, Member):
if ctx.author.top_role <= target.top_role and await config.guild(ctx.guild).respect_hierarchy() is True:
await ctx.send(
@ -100,6 +94,12 @@ async def check_moddable(
)
return False
if target.guild_permissions.administrator:
await ctx.send(
content="You cannot moderate members with the Administrator permission!", ephemeral=True
)
return False
if (
ctx.guild.get_member(ctx.bot.user.id).top_role
<= target.top_role