WIP: Refactor Aurora (3.0.0) #29

Draft
cswimr wants to merge 347 commits from aurora-pydantic into main
Showing only changes of commit 0411e3dab7 - Show all commits

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
)