Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/core/decorator.py
2021-07-09 17:35:23 +08:00

26 lines
No EOL
749 B
Python

from typing import Union, Coroutine, Optional
from .elements import Module
from .loader import ModulesManager
def command(
bind_prefix,
alias=None,
help_doc='',
need_self_process=False,
is_admin_function=False,
is_base_function=False,
is_superuser_function=False,
autorun=False
):
def decorator(function):
plugin = Module(function,
bind_prefix,
alias,
help_doc,
need_self_process,
is_admin_function,
is_base_function,
is_superuser_function,
autorun)
ModulesManager.add_plugin(plugin)
return decorator