Exemplo n.º 1
0
def command_handler(
    _func: CommandHandlerFunc | None = None,
    *,
    needs_auth: bool = True,
    needs_puppeting: bool = True,
    needs_matrix_puppeting: bool = False,
    needs_admin: bool = False,
    management_only: bool = False,
    name: str | None = None,
    help_text: str = "",
    help_args: str = "",
    help_section: HelpSection = None,
) -> Callable[[CommandHandlerFunc], CommandHandler]:
    return base_command_handler(
        _func,
        _handler_class=CommandHandler,
        name=name,
        help_text=help_text,
        help_args=help_args,
        help_section=help_section,
        management_only=management_only,
        needs_auth=needs_auth,
        needs_admin=needs_admin,
        needs_puppeting=needs_puppeting,
        needs_matrix_puppeting=needs_matrix_puppeting,
    )
Exemplo n.º 2
0
def command_handler(_func: Optional[Callable[[CommandEvent], Awaitable[Dict]]] = None, *,
                    needs_auth: bool = True, needs_admin: bool = False,
                    management_only: bool = False, name: Optional[str] = None,
                    help_text: str = "", help_args: str = "", help_section: HelpSection = None
                    ) -> Callable[[Callable[[CommandEvent], Awaitable[Optional[Dict]]]],
                                  CommandHandler]:
    return base_command_handler(_func, management_only=management_only, name=name,
                                help_text=help_text, help_args=help_args, help_section=help_section,
                                needs_auth=needs_auth, needs_admin=needs_admin,
                                _handler_class=CommandHandler)