From 66100f025f6705d68cf40549b5c2057d8426871f Mon Sep 17 00:00:00 2001 From: Kyomotoi Date: Sun, 27 Mar 2022 15:27:34 +0800 Subject: =?UTF-8?q?=F0=9F=9A=B8=F0=9F=9A=A8=20=E4=BC=98=E5=8C=96=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BD=93=E9=AA=8C=20&=20=E5=AE=89=E6=8A=9A=20pylance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/plugins/help/__init__.py | 27 ++++++++++++--------------- ATRI/plugins/help/data_source.py | 4 ++-- 2 files changed, 14 insertions(+), 17 deletions(-) (limited to 'ATRI/plugins/help') diff --git a/ATRI/plugins/help/__init__.py b/ATRI/plugins/help/__init__.py index d4b8b36..c6f915e 100644 --- a/ATRI/plugins/help/__init__.py +++ b/ATRI/plugins/help/__init__.py @@ -3,34 +3,31 @@ from nonebot.adapters.onebot.v11 import MessageEvent from .data_source import Helper -main_help = Helper().on_command("菜单", "获取食用bot的方法", aliases={"menu"}) +menu = Helper().on_command("菜单", "获取食用bot的方法", aliases={"menu"}) -@main_help.handle() -async def _main_help(): - repo = Helper().menu() - await main_help.finish(repo) +@menu.handle() +async def _(): + await menu.finish(Helper().menu()) -about_me = Helper().on_command("关于", "获取关于bot的信息", aliases={"about"}) +about = Helper().on_command("关于", "获取关于bot的信息", aliases={"about"}) -@about_me.handle() -async def _about_me(): - repo = Helper().about() - await about_me.finish(repo) +@about.handle() +async def _(): + await about.finish(Helper().about()) -service_list = Helper().on_command("服务列表", "查看所有可用服务", aliases={"功能列表"}) +service_list = Helper().on_command("服务列表", "获取服务列表", aliases={"功能列表"}) @service_list.handle() -async def _service_list(): - repo = Helper().service_list() - await service_list.finish(repo) +async def _(): + await service_list.finish(Helper().service_list()) -service_info = Helper().on_command("帮助", "获取服务详细帮助", aliases={"help"}) +service_info = Helper().on_command("帮助", "获取对应服务详细信息", aliases={"help"}) @service_info.handle() diff --git a/ATRI/plugins/help/data_source.py b/ATRI/plugins/help/data_source.py index f96d59e..e3dd1ff 100644 --- a/ATRI/plugins/help/data_source.py +++ b/ATRI/plugins/help/data_source.py @@ -72,7 +72,7 @@ class Helper(Service): ) table = tabulate( services, - headers=["服务名称", "开启状态", "仅支持管理员"], + headers=["服务名称", "开启状态(全局)", "仅支持管理员"], tablefmt="plain", showindex=True, ) @@ -91,7 +91,7 @@ class Helper(Service): service_enabled = data.get("enabled", True) _service_cmd_list = list(data.get("cmd_list", {"error"})) - service_cmd_list = "、".join(map(str, _service_cmd_list)) + service_cmd_list = "\n".join(map(str, _service_cmd_list)) repo = SERVICE_INFO_FORMAT.format( service=service_name, -- cgit v1.2.3