fix target query err not response

This commit is contained in:
felinae98 2021-12-10 14:07:49 +08:00
parent a7d8e4ec0c
commit 4158e5b76c
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610

View File

@ -61,11 +61,14 @@ def do_add_sub(add_sub: Type[Matcher]):
async def parse_id(bot: Bot, event: Event, state: T_State):
target = str(event.get_message()).strip()
name = await check_sub_target(state['platform'], target)
if not name:
try:
name = await check_sub_target(state['platform'], target)
if not name:
await add_sub.reject('id输入错误')
state['id'] = target
state['name'] = name
except:
await add_sub.reject('id输入错误')
state['id'] = target
state['name'] = name
@add_sub.got('id', _gen_prompt_template('{_prompt}'), parse_id)
@add_sub.handle()