🐛 修复白术和卡维ID混乱

This commit is contained in:
CMHopeSunshine 2023-05-04 10:32:36 +08:00
parent 814bb291e1
commit 062771790e
3 changed files with 21 additions and 20 deletions

View File

@ -412,10 +412,11 @@
"米卡" "米卡"
], ],
"10000081": [ "10000081": [
"白术" "卡维"
], ],
"10000082": [ "10000082": [
"卡维" "白术",
"白师傅"
] ]
}, },
"武器": { "武器": {

View File

@ -2191,20 +2191,7 @@
}, },
"SideIconName": "UI_AvatarIcon_Side_Mika" "SideIconName": "UI_AvatarIcon_Side_Mika"
}, },
"10000081": { "10000081": {
"SkillOrder": [
10801,
10802,
10805
],
"Skills": {
"10801": "Skill_A_Catalyst_MD",
"10802": "Skill_S_Baizhuer_01",
"10805": "Skill_E_Baizhuer_01"
},
"SideIconName": "UI_AvatarIcon_Side_Baizhuer"
},
"10000082": {
"SkillOrder": [ "SkillOrder": [
10801, 10801,
10802, 10802,
@ -2216,5 +2203,18 @@
"10805": "Skill_E_Kaveh_01" "10805": "Skill_E_Kaveh_01"
}, },
"SideIconName": "UI_AvatarIcon_Side_Kaveh" "SideIconName": "UI_AvatarIcon_Side_Kaveh"
},
"10000082": {
"SkillOrder": [
10801,
10802,
10805
],
"Skills": {
"10801": "Skill_A_Catalyst_MD",
"10802": "Skill_S_Baizhuer_01",
"10805": "Skill_E_Baizhuer_01"
},
"SideIconName": "UI_AvatarIcon_Side_Baizhuer"
} }
} }

View File

@ -5,7 +5,6 @@ from typing import Dict
from nonebot import on_regex from nonebot import on_regex
from nonebot.adapters.onebot.v11 import Message, MessageSegment, ActionFailed from nonebot.adapters.onebot.v11 import Message, MessageSegment, ActionFailed
from nonebot.adapters.onebot.v11.helpers import HandleCancellation
from nonebot.internal.matcher import Matcher from nonebot.internal.matcher import Matcher
from nonebot.internal.params import Arg, ArgPlainText from nonebot.internal.params import Arg, ArgPlainText
from nonebot.params import RegexDict from nonebot.params import RegexDict
@ -20,8 +19,7 @@ from LittlePaimon.utils.typing import COMMAND_START_RE
wiki_data: Dict[str, Dict[str, str]] = {} wiki_data: Dict[str, Dict[str, str]] = {}
last_update_time: datetime.datetime = datetime.datetime.now() last_update_time: datetime.datetime = datetime.datetime.now()
cancel = [HandleCancellation(f'好吧,有需要再找{NICKNAME}')] GAME_ALIAS = ['星穹铁道', '星铁', '崩铁', '穹轨', '铁轨', '铁道', escape('*'), '']
GAME_ALIAS = ['星穹铁道', '星铁', '崩铁', '穹轨', '铁轨', escape('*'), '']
BASE_TYPE = ['图鉴', '材料', '角色图鉴', '角色材料', '遗器图鉴', '光锥图鉴'] BASE_TYPE = ['图鉴', '材料', '角色图鉴', '角色材料', '遗器图鉴', '光锥图鉴']
GAME_ALIAS_RE = '(' + '|'.join(GAME_ALIAS) + ')' GAME_ALIAS_RE = '(' + '|'.join(GAME_ALIAS) + ')'
BASE_TYPE_RE = '(' + '|'.join(BASE_TYPE) + ')' BASE_TYPE_RE = '(' + '|'.join(BASE_TYPE) + ')'
@ -85,11 +83,13 @@ async def sr_wiki_handler(state: T_State, regex_dict: dict = RegexDict()):
state['times'] = 1 state['times'] = 1
@wiki.got('name', prompt=Message.template('目前支持以下{type}\n{name_list}\n你要查询哪个呢?'), parameterless=cancel) @wiki.got('name', prompt=Message.template('目前支持以下{type}\n{name_list}\n你要查询哪个呢?'))
async def sr_wiki_got(matcher: Matcher, async def sr_wiki_got(matcher: Matcher,
state: T_State, state: T_State,
type: str = Arg('type'), type: str = Arg('type'),
name: str = ArgPlainText('name')): name: str = ArgPlainText('name')):
if name in {'取消', '退出', '结束'}:
await wiki.finish(f'好吧,有需要再找{NICKNAME}')
if not name: if not name:
if state['times'] == 2: if state['times'] == 2:
await wiki.finish('旅行者似乎不太能理解,下次再问我吧' + MessageSegment.face(146)) await wiki.finish('旅行者似乎不太能理解,下次再问我吧' + MessageSegment.face(146))