zhenxun_bot/basic_plugins/super_help/__init__.py

25 lines
652 B
Python
Raw Normal View History

2021-11-23 21:44:59 +08:00
from nonebot import on_command
from nonebot.permission import SUPERUSER
from nonebot.rule import to_me
from utils.message_builder import image
from .data_source import create_help_image, SUPERUSER_HELP_IMAGE
2021-11-23 21:44:59 +08:00
__zx_plugin_name__ = '超级用户帮助 [Superuser]'
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 _():
if not SUPERUSER_HELP_IMAGE.exists():
2021-11-23 21:44:59 +08:00
await create_help_image()
x = image(SUPERUSER_HELP_IMAGE)
2021-11-23 21:44:59 +08:00
await super_help.finish(x)