2021-11-23 21:44:59 +08:00
|
|
|
from nonebot import on_command
|
|
|
|
|
from nonebot.permission import SUPERUSER
|
|
|
|
|
from nonebot.rule import to_me
|
2023-02-18 18:46:54 +08:00
|
|
|
|
2021-11-23 21:44:59 +08:00
|
|
|
from utils.message_builder import image
|
|
|
|
|
|
2023-02-18 18:46:54 +08:00
|
|
|
from .data_source import SUPERUSER_HELP_IMAGE, create_help_image
|
2021-11-23 21:44:59 +08:00
|
|
|
|
2023-02-18 18:46:54 +08:00
|
|
|
__zx_plugin_name__ = "超级用户帮助 [Superuser]"
|
2021-11-23 21:44:59 +08:00
|
|
|
|
|
|
|
|
|
2022-12-24 00:16:17 +08:00
|
|
|
if SUPERUSER_HELP_IMAGE.exists():
|
|
|
|
|
SUPERUSER_HELP_IMAGE.unlink()
|
2021-11-23 21:44:59 +08:00
|
|
|
|
|
|
|
|
super_help = on_command(
|
|
|
|
|
"超级用户帮助", rule=to_me(), priority=1, permission=SUPERUSER, block=True
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@super_help.handle()
|
2022-02-19 18:20:19 +08:00
|
|
|
async def _():
|
2022-12-24 00:16:17 +08:00
|
|
|
if not SUPERUSER_HELP_IMAGE.exists():
|
2021-11-23 21:44:59 +08:00
|
|
|
await create_help_image()
|
2023-02-18 18:46:54 +08:00
|
|
|
await super_help.finish(image(SUPERUSER_HELP_IMAGE))
|