补充草主图鉴

This commit is contained in:
惜月 2022-08-30 05:40:51 +00:00
parent 1f35356a64
commit cae77e6b75

View File

@ -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 = {}