From 0411e3dab732bb4efbc4d5678dccfb8794084829 Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Fri, 24 May 2024 03:49:55 -0400 Subject: [PATCH] fix(aurora): fixed a typeerror in the check_moddable function --- aurora/utilities/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/aurora/utilities/utils.py b/aurora/utilities/utils.py index ed115de..42ce1cb 100644 --- a/aurora/utilities/utils.py +++ b/aurora/utilities/utils.py @@ -3,7 +3,7 @@ from datetime import datetime, timedelta from typing import Optional, Union 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 redbot.core import commands, data_manager from redbot.core.utils.chat_formatting import error @@ -40,9 +40,10 @@ def check_permissions( async def check_moddable( - target: Union[User, Member], interaction: Interaction, permissions: list + target: Union[User, Member, TextChannel], interaction: Interaction, permissions: list ) -> bool: """Checks if a moderator can moderate a target.""" + is_channel = isinstance(target, TextChannel) if check_permissions(interaction.client.user, permissions, guild=interaction.guild): await interaction.response.send_message( error( @@ -68,7 +69,7 @@ async def check_moddable( ) return False - if target.bot: + if not is_channel and target.bot: await interaction.response.send_message( content="You cannot moderate bots!", ephemeral=True )