Nonebot-plugin-alconna

Latest version: v0.45.4

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

Scan your dependencies

Page 1 of 18

0.45.4

What's Changed
* 修改 exporter 中 各适配器msg 的构造
* :arrow_up: auto update by pre-commit hooks by pre-commit-ci in https://github.com/nonebot/plugin-alconna/pull/48


**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.45.3...v0.45.4

0.45.3

- builtins.extensions.__init__ 移除 DiscordSlashExtension
- 调整 TelegramSlashExtension 的 docstring
- 为 `UniMessage` 增加 `finish`

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.45.2...v0.45.3

0.45.2

- 修复 satori 适配器下 Target 的构建
- 增加检查 satori 适配器版本

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.45.1...v0.45.2

0.45.1

What's Changed
* 升级 nonebot2 依赖版本至 2.3.0
* ⬆️ Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 by dependabot in https://github.com/nonebot/plugin-alconna/pull/47

> [!NOTE]
> 随着 nonebot2 升级至 2.3.0,本插件同样也放弃了对 python 3.8 的支持。

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

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

Page 1 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.