From 06a9d99c00f2554eb8f9afe5240a3dd1de863a2c Mon Sep 17 00:00:00 2001 From: iwumingz Date: Sat, 9 Apr 2022 13:13:02 +0800 Subject: [PATCH] Change the return type to dict --- tools/updates.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/updates.py b/tools/updates.py index b38b879..9d16496 100644 --- a/tools/updates.py +++ b/tools/updates.py @@ -71,13 +71,10 @@ def reset_cmd_alias(source: str) -> None: update_cmd_yml(cmd_yml=cmd_yml) -def get_alias_of_cmds() -> str: +def get_alias_of_cmds() -> Dict[str, str]: with open(COMMAND_YML, "rb") as f: cmd_yml: Dict[str, Dict[str, str]] = yaml.full_load(f) - tmp = ''.join( - f"`{k}` | `{v.get('cmd')}`\n" for k, v in cmd_yml.items() - ) - return f"**⭐️ 指令别名:**\n**源名** | **别名**\n{tmp}" + return dict(zip(cmd_yml.keys(), (v.get('cmd') for v in cmd_yml.values()))) async def pull_and_update_command_yml() -> None: