Releases: nonebot/plugin-alconna
Releases · nonebot/plugin-alconna
Nonebot Plugin Alconna 0.16.0
变更
- 增加
Command便捷命令创建器:book = ( Command("book", "测试") .option("writer", "-w <id:int>") .option("writer", "--anonymous", {"id": 0}) .usage("book [-w <id:int> | --anonymous]") .shortcut("测试", {"args": ["--anonymous"]}) .build() ) @book.handle() async def test1_h(arp: Arparma = AlconnaMatches()): await book.send(str(arp.options))
Full Changelog: v0.15.0...v0.16.0
Nonebot Plugin Alconna 0.15.0
What's Changed
- Alconna 依赖升级至 1.7.17
- 新增适配器: Discord (https://github.com/nonebot/plugin-alconna/tree/master/src/nonebot_plugin_alconna/adapters/discord.py)
- 为Reply添加Discord和Kaiheila适配 by @canxin121 in #3
AlconnaMatcher增加方法shortcut()作为Alconna.shortcut的快捷调用
New Contributors
- @canxin121 made their first contribution in #3
Full Changelog: v0.14.2...v0.15.0
Nonebot Plugin Alconna 0.14.2
新增
- 为
AlconnaMatch与AlconnaQuery新增middleware参数,用于对匹配参数进行自定义处理 - 增加内置 middleware
image_fetch,用于拉取图片参数的二进制数据 - 为 Alconna 下常用组件进行了 re-export
Full Changelog: v0.14.1...v0.14.2
Nonebot Plugin Alconna 0.14.1
- segmatch 现在支持 Reply 匹配了
Reply的 origin 现在包括原始 segment,适配器特定的reply: Model或reply: Message
Full Changelog: v0.14.0...v0.14.1
Nonebot Plugin Alconna 0.14.0
- 新增通用标注
Reply:class Reply(Segment): id: str msg: Optional[str]
- 新增规则
seg_match与对应的依赖注入SegMatchMessage和SegMatchResult, 用于配合通用标注:from nonebot_plugin_alconna import Image, seg_match, SegMatchResult xxx = on_message(rule=seg_match(Image)) @xxx.handle() async def _(image: Image = SegMatchResult(Image)): await xxx.send(image.url)
因为nonebot下各适配器对 Reply 元素的处理方式各不相同,同时nonebot既没有约定统一的获取不经过check_tome等的原始消息的接口,也没有统一如MessageEvent.reply的格式,导致此次更新对于获取Reply的内容是毫无帮助的
Full Changelog: v0.13.0...v0.14.0
Nonebot Plugin Alconna 0.13.0
Nonebot Plugin Alconna 0.12.1
Nonebot Plugin Alconna 0.12.0
变更
- AlconnaMatcher 新增方法
got_path, 其作为got方法的拓展,会以 path 上的参数为准,读取传入 message的最后一个消息段并验证转换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: v0.11.2...v0.12.0
Nonebot Plugin Alconna 0.11.2
Nonebot Plugin Alconna 0.11.1
- 修复通用标注无法匹配频道图片的问题 #1
- 为tg适配器增加img or url
Full Changelog: v0.11.0...v0.11.1