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

30 lines
820 B
Python
Raw Normal View History

2021-07-13 15:48:43 +00:00
from core.elements import Module
2021-07-09 09:35:23 +00:00
from .loader import ModulesManager
2021-07-06 18:00:26 +00:00
2021-07-19 16:12:29 +00:00
2021-07-06 18:00:26 +00:00
def command(
2021-07-19 16:12:29 +00:00
bind_prefix,
alias=None,
help_doc=None,
need_self_process=False,
is_admin_function=False,
is_base_function=False,
is_superuser_function=False,
2021-07-26 14:33:49 +00:00
is_regex_function=False,
2021-07-19 16:12:29 +00:00
autorun=False
2021-07-06 18:00:26 +00:00
):
2021-07-07 16:00:24 +00:00
def decorator(function):
2021-07-09 09:35:23 +00:00
plugin = Module(function,
2021-07-07 16:00:24 +00:00
bind_prefix,
alias,
help_doc,
need_self_process,
is_admin_function,
is_base_function,
is_superuser_function,
2021-07-26 14:33:49 +00:00
is_regex_function,
2021-07-07 16:00:24 +00:00
autorun)
ModulesManager.add_module(plugin)
2021-07-19 16:12:29 +00:00
return decorator