Nonebot-plugin-alconna

Latest version: v0.46.3

Safety actively analyzes 634425 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 17 of 18

0.14.1

- segmatch 现在支持 Reply 匹配了
- `Reply` 的 origin 现在包括原始 segment,适配器特定的`reply: Model`或`reply: Message`

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.14.0...v0.14.1

0.14.0

- 新增通用标注 `Reply`:
python
class Reply(Segment):
id: str
msg: Optional[str]

- 新增规则 `seg_match` 与对应的依赖注入 `SegMatchMessage` 和 `SegMatchResult`, 用于配合通用标注:
python
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**: https://github.com/nonebot/plugin-alconna/compare/v0.13.0...v0.14.0

0.13.0

变更
- 增加适配器: [Villa](https://github.com/nonebot/plugin-alconna/tree/master/src/nonebot_plugin_alconna/adapters/villa.py)

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.12.1...v0.13.0

0.12.1

变更
- 修复通用标注无法匹配 telegram 适配器下的图片的问题
- `got_path` 先执行 paramless depend

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.12.0...v0.12.1

0.12.0

变更
- 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

0.11.2

变更
- 增加配置项目 `use_origin`,选择是否使用未经 to_me 等处理过的消息来解析

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.11.1...v0.11.2

Page 17 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.