WIP: Refactor Aurora (3.0.0) #29

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

View file

@ -22,10 +22,6 @@ async def moderate(ctx: Union[commands.Context, discord.Interaction], target: di
moderation_type (Type): The moderation type (handler) to use. See `aurora.models.moderation_types` for some examples.
**kwargs: The keyword arguments to pass to the handler method.
"""
if not await check_moddable(target, ctx, permissions):
return
if silent is None:
silent = not await config.guild(ctx.guild).dm_users()
if isinstance(moderation_type, str):
moderation_type = type_registry[str.lower(moderation_type)]
if isinstance(ctx, discord.Interaction):
@ -33,6 +29,10 @@ async def moderate(ctx: Union[commands.Context, discord.Interaction], target: di
ctx = await commands.Context.from_interaction(interaction)
if isinstance(interaction.command, app_commands.ContextMenu):
ctx.author = interaction.user
if not await check_moddable(target, ctx, permissions):
return
if silent is None:
silent = not await config.guild(ctx.guild).dm_users()
return await moderation_type.handler(
ctx,
target,