Nonebot-plugin-alconna

Latest version: v0.53.1

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

Scan your dependencies

Page 21 of 22

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

0.11.1

- 修复通用标注无法匹配频道图片的问题 https://github.com/nonebot/plugin-alconna/issues/1
- 为tg适配器增加img or url
**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.11.0...v0.11.1

Page 21 of 22

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.