diff --git a/LittlePaimon/plugins/Paimon_Wiki/__init__.py b/LittlePaimon/plugins/Paimon_Wiki/__init__.py index 917858d..51d93d2 100644 --- a/LittlePaimon/plugins/Paimon_Wiki/__init__.py +++ b/LittlePaimon/plugins/Paimon_Wiki/__init__.py @@ -55,12 +55,6 @@ total_wiki = on_regex( 'pm_usage': '<对象名><图鉴|攻略|材料>', 'pm_priority': 1 }) -# material_map = on_command('材料图鉴', priority=11, block=True, state={ -# 'pm_name': '材料图鉴', -# 'pm_description': '查看某个材料的介绍和采集点。', -# 'pm_usage': '材料图鉴<材料名>[地图]', -# 'pm_priority': 2 -# }) material_map_full = on_command('材料地图', priority=8, block=True, state={ 'pm_name': '材料地图', 'pm_description': '查看多个材料大地图采集点。\n示例:材料地图 鸣草 鬼兜虫 提瓦特', @@ -89,39 +83,6 @@ card_wiki_list = on_command('七圣召唤列表', aliases={'七圣召唤卡牌 }) -# @material_map.handle() -# async def _(event: MessageEvent, state: T_State, msg: Message = CommandArg()): -# if params := msg.extract_plain_text().strip(): -# params = params.split(' ') -# state['name'] = Message(params[0]) -# if len(params) > 1: -# if params[1] in {'提瓦特', '层岩巨渊', '渊下宫'}: -# state['map'] = params[1] -# else: -# state['map'] = Message('提瓦特') -# else: -# state['map'] = Message('提瓦特') - - -# @material_map.got('map', prompt='地图名称有误,请在【提瓦特、层岩巨渊、渊下宫】中选择,或回答【取消】退出', -# parameterless=cancel) -# async def _(event: MessageEvent, state: T_State, map_: str = ArgPlainText('map')): -# if map_ not in {'提瓦特', '层岩巨渊', '渊下宫'}: -# await material_map.reject('地图名称有误,请在【提瓦特、层岩巨渊、渊下宫】中选择') -# else: -# state['map'] = Message(map_) -# -# -# @material_map.got('name', prompt='请输入要查询的材料名称,或回答【取消】退出', -# parameterless=cancel) -# async def _(event: MessageEvent, map_: str = ArgPlainText('map'), name: str = ArgPlainText('name')): -# if (file_path := RESOURCE_BASE_PATH / 'genshin_map' / 'results' / f'{map_}_{name}.png').exists(): -# await material_map.finish(MessageSegment.image(file_path), at_sender=True) -# else: -# await material_map.send(MessageBuild.Text(f'开始查找{name}的资源点,请稍候...')) -# result = await draw_map(name, map_) -# await material_map.finish(result, at_sender=True) - @material_map_full.handle() async def _(event: MessageEvent, state: T_State, msg: Message = CommandArg()): diff --git a/LittlePaimon/utils/typing.py b/LittlePaimon/utils/typing.py index 2667b3a..b0235c6 100644 --- a/LittlePaimon/utils/typing.py +++ b/LittlePaimon/utils/typing.py @@ -16,7 +16,7 @@ command_start_new = [(f'\\{c}' if c in need_escape else c) for c in command_star COMMAND_START_RE = ( '^(' + '|'.join(command_start_new) + ')' if command_start_new else '^' ) -if '' in command_start: +if command_start_new and '' in command_start: COMMAND_START_RE += '?'