变更
- AlconnaMatcher 新增方法 `got_path`, 其作为 `got` 方法的拓展,会以 path 上的参数为准,读取传入 message的最后一个消息段并验证转换
python
from nonebot_plugin_alconna import on_alconna, AlconnaMatcher, AlconnaMatch, AlconnaArg
test_cmd = on_alconna(Alconna("search", Args["img?", Image]))
test_cmd.handle()
async def test_handle(matcher: AlconnaMatcher, img: Match[Image] = AlconnaMatch("img")):
if img.available:
matcher.set_path_arg("img", img.result)
test_cmd.got_path("img", prompt="请输入图片")
async def test_got(img: Image = AlconnaArg("img")):
await test_cmd.finish(await search(img.url))
- AlconnaMatcher 增加方法 `set_path_arg`, `get_path_arg` , 类似 `set_arg`, `get_arg`
**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.11.2...v0.12.0