mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-09 18:27:56 +08:00
✨ ParseTargetException可以携带prompt参数 (#479)
* ✨ ParseTargetException可以携带prompt参数 * ✨ 丰富prompt提示
This commit is contained in:
@@ -86,8 +86,10 @@ def do_add_sub(add_sub: type[Matcher]):
|
||||
await add_sub.reject("id输入错误")
|
||||
state["id"] = raw_id_text
|
||||
state["name"] = name
|
||||
except Platform.ParseTargetException:
|
||||
await add_sub.reject("不能从你的输入中提取出id,请检查你输入的内容是否符合预期")
|
||||
except Platform.ParseTargetException as e:
|
||||
await add_sub.reject(
|
||||
"不能从你的输入中提取出id,请检查你输入的内容是否符合预期" + (f"\n{e.prompt}" if e.prompt else "")
|
||||
)
|
||||
else:
|
||||
await add_sub.send(
|
||||
f"即将订阅的用户为:{state['platform']} {state['name']} {state['id']}\n如有错误请输入“取消”重新订阅"
|
||||
|
||||
Reference in New Issue
Block a user