mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2024-10-21 16:27:15 +08:00
✨补充草主图鉴
This commit is contained in:
parent
1f35356a64
commit
cae77e6b75
@ -19,7 +19,7 @@ def get_short_name(name: str) -> str:
|
|||||||
return name if name not in short_name.keys() else short_name[name]
|
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
|
根据角色名字获取角色的id
|
||||||
:param name: 角色名
|
:param name: 角色名
|
||||||
@ -31,7 +31,7 @@ def get_id_by_name(name: str) -> str:
|
|||||||
return role_id
|
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获取角色名
|
根据角色id获取角色名
|
||||||
:param role_id: 角色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
|
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: 角色名
|
:param name: 角色名
|
||||||
@ -63,7 +63,7 @@ def get_match_alias(msg: str, type: Literal['角色', '武器', '原魔', '圣
|
|||||||
:return: 匹配的字符串、列表或字典
|
:return: 匹配的字符串、列表或字典
|
||||||
"""
|
"""
|
||||||
alias_list = alias_file[type]
|
alias_list = alias_file[type]
|
||||||
if msg in {'风主', '岩主', '雷主'}:
|
if msg in {'风主', '岩主', '雷主', '草主'}:
|
||||||
return msg
|
return msg
|
||||||
elif type == '角色':
|
elif type == '角色':
|
||||||
possible = {}
|
possible = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user