fix(aurora): fixed a typeerror in the check_moddable function

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

View file

@ -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
)