fix(aurora): fixed a typeerror in the check_moddable function
All checks were successful
Actions / Build Documentation (MkDocs) (pull_request) Successful in 27s
Actions / Lint Code (Ruff & Pylint) (pull_request) Successful in 39s

This commit is contained in:
Seaswimmer 2024-05-24 03:49:55 -04:00
parent 67b33a2eb8
commit 0411e3dab7
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -3,7 +3,7 @@ from datetime import datetime, timedelta
from typing import Optional, Union from typing import Optional, Union
from dateutil.relativedelta import relativedelta as rd from dateutil.relativedelta import relativedelta as rd
from discord import File, Guild, Interaction, Member, SelectOption, User from discord import File, Guild, Interaction, Member, SelectOption, TextChannel, User
from discord.errors import Forbidden from discord.errors import Forbidden
from redbot.core import commands, data_manager from redbot.core import commands, data_manager
from redbot.core.utils.chat_formatting import error from redbot.core.utils.chat_formatting import error
@ -40,9 +40,10 @@ def check_permissions(
async def check_moddable( async def check_moddable(
target: Union[User, Member], interaction: Interaction, permissions: list target: Union[User, Member, TextChannel], interaction: Interaction, permissions: list
) -> bool: ) -> bool:
"""Checks if a moderator can moderate a target.""" """Checks if a moderator can moderate a target."""
is_channel = isinstance(target, TextChannel)
if check_permissions(interaction.client.user, permissions, guild=interaction.guild): if check_permissions(interaction.client.user, permissions, guild=interaction.guild):
await interaction.response.send_message( await interaction.response.send_message(
error( error(
@ -68,7 +69,7 @@ async def check_moddable(
) )
return False return False
if target.bot: if not is_channel and target.bot:
await interaction.response.send_message( await interaction.response.send_message(
content="You cannot moderate bots!", ephemeral=True content="You cannot moderate bots!", ephemeral=True
) )