feat(aurora): boilerplate for all currently added moderation types
This commit is contained in:
parent
a05e957dde
commit
8f0425456c
4 changed files with 201 additions and 21 deletions
|
@ -9,14 +9,14 @@ from .registry import type_registry
|
|||
from .utils import check_moddable
|
||||
|
||||
|
||||
async def moderate(ctx: Union[commands.Context, discord.Interaction], target: discord.Member, silent: bool | None, permissions: List[str], moderation_type: Type | str, **kwargs) -> None | Type:
|
||||
async def moderate(ctx: Union[commands.Context, discord.Interaction], target: discord.Member | discord.User | discord.abc.Messageable, silent: bool | None, permissions: List[str], moderation_type: Type | str, **kwargs) -> None | Type:
|
||||
"""This function is used to moderate users.
|
||||
It checks if the target can be moderated, then calls the handler method of the moderation type specified.
|
||||
|
||||
Args:
|
||||
bot (Red): The bot instance.
|
||||
ctx (Union[commands.Context, discord.Interaction]): The context of the command. If this is a `discord.Interaction` object, it will be converted to a `commands.Context` object. Additionally, if the interaction orignated from a context menu, the `ctx.author` attribute will be overriden to `interaction.user`.
|
||||
target (discord.Member): The target user to moderate.
|
||||
target (discord.Member, discord.User, discord.abc.Messageable): The target user or channel to moderate.
|
||||
silent (bool | None): Whether to send the moderation action to the target.
|
||||
permissions (List[str]): The permissions required to moderate the target.
|
||||
moderation_type (Type): The moderation type (handler) to use. See `aurora.models.moderation_types` for some examples.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue