Nonebot-plugin-alconna

Latest version: v0.45.0

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

Scan your dependencies

Page 1 of 17

0.45.0

破坏性改动

- 删除 `Custom`

新增
- `builtins` 模块,目前包括 `extensions`,`plugins` 和 `uniseg`
- `extensions` 模块目前包含:
- `ReplyRecordExtension`: 将消息事件中的回复暂存在 extension 中,使得解析用的消息不带回复信息,同时可以在后续的处理中获取回复信息。
- `DiscordSlashExtension`: 将 Alconna 的命令自动转换为 Discord 的 Slash Command,并将 Slash Command 的交互事件转换为消息交给 Alconna 处理。
- `MarkdownOutputExtension`: 将 Alconna 的自动输出转换为 Markdown 格式
- `TelegramSlashExtension`: 将 Alconna 的命令注册在 Telegram 上以获得提示。
- `plugins` 目前有 `echo` 和 `help` 两个插件
- `uniseg` 目前有 `chronocat` 模块,拓展了 `chronocat:face` 和 `chronocat:marketface`

改进
- 原 `custom_register` 现不再限制为 `Custom` 子类的构造,任意 Segment 子类都可
- 原 `Custom.export` 改为 `custom_handler`,允许任意 Segment 子类转为适配器对应消息段

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.44.0...v0.45.0

0.44.0

破坏性改动
- `Custom.export` 和 `custom_register` 所需函数的签名分别增加了 `exporter` 和 `builder`
- `Reference` 的 `content` 参数被移除

新增
- `Segment` 新增 `children` 属性,即支持嵌套元素
- `Segment` 实例可以通过 `__call__`来增加子元素:
python
video = Video(url="https://www.bilibili.com/video/BV15p421S7da")(
Text("当前平台不支持发送视频,请在 https://www.bilibili.com/video/BV15p421S7da 观看视频!")
.mark(15, 58, "link")
)

- 新增 `Segment.from_`,`select` 等方法,以表达提取嵌套元素:
python
from nepattern import Dot
from nonebot_plugin_alconna import Image, Video, select_first
from nonebot_plugin_alconna.typings import Link

该指令接收任意可提取出图片的元素,并返回第一个图片的 url
m1 = Alconna("/m1", Args["img", Dot(select_first(Image), str, "url")])
该指令接收链接或者视频元素里的链接
m2 = Alconna("/m2", Args["link", [Link, Link.from_(Video)]])


改进
- 类 koishi 构造器 `Command` 的参数现在能塞入 UniSeg 了:
python
from nonebot_plugin_alconna import Command

cmd = Command("/test <img:Image>").build()


**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.43.0...v0.44.0

0.43.0

- 增加适配器 [`Kritor`](https://github.com/nonebot/adapter-kritor)

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.42.5...v0.43.0

0.42.5

升级依赖

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.42.4...v0.42.5

0.42.4

- 修复 UniMessage 出现的递归 bug

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.42.3...v0.42.4

0.42.3

- 修复未增加 `onebot12` target fetcher 的问题
- 去掉 `Target` 的 dataclass 以避免 pyd 的加料

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.42.2...v0.42.3

Page 1 of 17

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.