From 062771790edd22a181c1f71a7022e5abdeb11064 Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Thu, 4 May 2023 10:32:36 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E7=99=BD=E6=9C=AF?= =?UTF-8?q?=E5=92=8C=E5=8D=A1=E7=BB=B4ID=E6=B7=B7=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LittlePaimon/config/data/alias.json | 5 ++-- LittlePaimon/config/data/genshin_info.json | 28 +++++++++---------- .../plugins/star_rail_wiki/__init__.py | 8 +++--- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/LittlePaimon/config/data/alias.json b/LittlePaimon/config/data/alias.json index 6f75a0e..492393c 100644 --- a/LittlePaimon/config/data/alias.json +++ b/LittlePaimon/config/data/alias.json @@ -412,10 +412,11 @@ "米卡" ], "10000081": [ - "白术" + "卡维" ], "10000082": [ - "卡维" + "白术", + "白师傅" ] }, "武器": { diff --git a/LittlePaimon/config/data/genshin_info.json b/LittlePaimon/config/data/genshin_info.json index c07f847..665a2f2 100644 --- a/LittlePaimon/config/data/genshin_info.json +++ b/LittlePaimon/config/data/genshin_info.json @@ -2191,20 +2191,7 @@ }, "SideIconName": "UI_AvatarIcon_Side_Mika" }, - "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": { + "10000081": { "SkillOrder": [ 10801, 10802, @@ -2216,5 +2203,18 @@ "10805": "Skill_E_Kaveh_01" }, "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" } } \ No newline at end of file diff --git a/LittlePaimon/plugins/star_rail_wiki/__init__.py b/LittlePaimon/plugins/star_rail_wiki/__init__.py index fedc654..d938cc8 100644 --- a/LittlePaimon/plugins/star_rail_wiki/__init__.py +++ b/LittlePaimon/plugins/star_rail_wiki/__init__.py @@ -5,7 +5,6 @@ from typing import Dict from nonebot import on_regex 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.params import Arg, ArgPlainText from nonebot.params import RegexDict @@ -20,8 +19,7 @@ from LittlePaimon.utils.typing import COMMAND_START_RE wiki_data: Dict[str, Dict[str, str]] = {} last_update_time: datetime.datetime = datetime.datetime.now() -cancel = [HandleCancellation(f'好吧,有需要再找{NICKNAME}')] -GAME_ALIAS = ['星穹铁道', '星铁', '崩铁', '穹轨', '铁轨', escape('*'), ''] +GAME_ALIAS = ['星穹铁道', '星铁', '崩铁', '穹轨', '铁轨', '铁道', escape('*'), ''] BASE_TYPE = ['图鉴', '材料', '角色图鉴', '角色材料', '遗器图鉴', '光锥图鉴'] GAME_ALIAS_RE = '(' + '|'.join(GAME_ALIAS) + ')' 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 -@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, state: T_State, type: str = Arg('type'), name: str = ArgPlainText('name')): + if name in {'取消', '退出', '结束'}: + await wiki.finish(f'好吧,有需要再找{NICKNAME}') if not name: if state['times'] == 2: await wiki.finish('旅行者似乎不太能理解,下次再问我吧' + MessageSegment.face(146))