From cae77e6b75965340e90eb3041bfe2be485dfdddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=83=9C=E6=9C=88?= <63870437+CMHopeSunshine@users.noreply.github.com> Date: Tue, 30 Aug 2022 05:40:51 +0000 Subject: [PATCH] =?UTF-8?q?:sparkles:=E8=A1=A5=E5=85=85=E8=8D=89=E4=B8=BB?= =?UTF-8?q?=E5=9B=BE=E9=89=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LittlePaimon/utils/alias.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LittlePaimon/utils/alias.py b/LittlePaimon/utils/alias.py index 96e6c66..2e18d55 100644 --- a/LittlePaimon/utils/alias.py +++ b/LittlePaimon/utils/alias.py @@ -19,7 +19,7 @@ def get_short_name(name: str) -> str: return name if name not in short_name.keys() else short_name[name] -def get_id_by_name(name: str) -> str: +def get_id_by_name(name: str) -> Optional[str]: """ 根据角色名字获取角色的id :param name: 角色名 @@ -31,7 +31,7 @@ def get_id_by_name(name: str) -> str: return role_id -def get_name_by_id(role_id: Union[str, int]) -> str: +def get_name_by_id(role_id: Union[str, int]) -> Optional[str]: """ 根据角色id获取角色名 :param role_id: 角色id @@ -43,7 +43,7 @@ def get_name_by_id(role_id: Union[str, int]) -> str: return name_list[role_id][0] if role_id in name_list else None -def get_alias_by_name(name: str) -> List[str]: +def get_alias_by_name(name: str) -> Optional[List[str]]: """ 根据角色名字获取角色的别名 :param name: 角色名 @@ -63,7 +63,7 @@ def get_match_alias(msg: str, type: Literal['角色', '武器', '原魔', '圣 :return: 匹配的字符串、列表或字典 """ alias_list = alias_file[type] - if msg in {'风主', '岩主', '雷主'}: + if msg in {'风主', '岩主', '雷主', '草主'}: return msg elif type == '角色': possible = {}