查询优化,修复查询开拓者报错 (#19)

* 查询优化,修复查询开拓者报错

* 查询优化,修复查询开拓者报错
This commit is contained in:
季落 2023-05-15 14:18:41 +08:00 committed by GitHub
parent 0807821dd6
commit 1a178c99c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -16,7 +16,7 @@ from ..utils.error_reply import CHAR_HINT
from ..utils.fonts.first_world import fw_font_28
from ..utils.map.SR_MAP_PATH import RelicId2Rarity
from ..utils.excel.read_excel import light_cone_ranks
from ..utils.map.name_covert import alias_to_char_name
from ..utils.map.name_covert import name_to_avatar_id, alias_to_char_name
from ..utils.resource.RESOURCE_PATH import (
RELIC_PATH,
SKILL_PATH,
@ -590,7 +590,11 @@ async def get_char_data(
) -> Union[Dict, str]:
player_path = PLAYER_PATH / str(sr_uid)
SELF_PATH = player_path / 'SELF'
char_name = await alias_to_char_name(char_name)
if "开拓者" in str(char_name):
char_name = "开拓者"
char_id = await name_to_avatar_id(char_name)
if char_id == '':
char_name = await alias_to_char_name(char_name)
if char_name is False:
return "请输入正确的角色名"
char_path = player_path / f'{char_name}.json'

View File

@ -44,7 +44,8 @@
"天才俱乐部#83",
"天才俱乐部第83席",
"天才俱乐部第八十三席",
"黑塔女士"
"黑塔女士",
"转圈圈"
],
"1003": [
"姬子",
@ -127,6 +128,7 @@
"骚狐狸"
],
"8002": [
"开拓者",
"开拓者物理",
"爷",
"星爷",
@ -141,6 +143,7 @@
"毁灭主"
],
"8004": [
"开拓者",
"开拓者火",
"火主",
"存护主"