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 19 of 22

0.21.0

What's Changed
* `AlconnaMatcher` 新增方法 `dispatch`,其作用类似于 `assign` ,但是返回一个新的 Matcher,该 matcher 的优先级一定低于原 matcher
* 除了 `Other` 与 `Reply`,其余的 UniSeg 不再接受 `origin`
* `Media` 类通用标注增加字段 `raw: bytes`
* `+` 操作现在可用于通用标注与通用消息上:
python
msg = At("user", "123") + "abc" + Image(path="path/to/img")
reveal_type(msg) UniMessage(Union[At, str, Image])

* 新增依赖注入器 `UniversalSegment(type: TS, index: int = 0)`
* ⬆️ Bump actions/checkout from 3 to 4 by dependabot in https://github.com/nonebot/plugin-alconna/pull/4

New Contributors
* dependabot made their first contribution in https://github.com/nonebot/plugin-alconna/pull/4

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.20.0...v0.21.0

0.20.0

变更
- 增加适配器 `Red Protocol`
- 增加通用标注 `Card`, 可用于匹配小程序等类型的消息元素

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.19.2...v0.20.0

0.19.2

- 修复在 AlconnaParam 中 subclass 的问题 (例如 a: Optional[str])

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.19.1...v0.19.2

0.19.1

- `AlconnaMatcher` 增加方法 `reject_path`,与 `reject_arg` 类似

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.19.0...v0.19.1

0.19.0

破坏性改动
- `adapters.__init__` 内的内容移动至 `./uniseg.py`
- 移除 `SegMatch` 相关内容

新增
- `on_alconna` 增加参数 `use_cmd_start`, 以便局部使用nb配置里的命令前缀 (前提是命令本体没有手动传入前缀)
- 新增通用标记 `Other`, 用于标记所有特殊类型
- 新增依赖注入函数 `UniversalMessage` ( Annotated 版本为 `UniMsg`),返回类似于 `Message` 的 `UniMessage`
- 新增类 `UniMessage`, 其与 `Message` 类似,但操作类型为 `Segment`:
python
from nonebot_plugin_alconna import UniMsg, Reply, Image, At
...
matcher = on_xxx(...)
matcher.handle()
async def _(msg: UniMsg):
reply = msg[Reply, 0] type: Reply
ats = msg.get(At) type: UniMessage[At]
await matcher.send(f"{reply}{ats}")
if msg.has(Image):
for img in msg[Image, 1:]:
await matcher.send(img.url)
await matcher.finish(msg.extract_plain_text())


**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.18.1...v0.19.0

0.18.1

- 修改部分名称与类型错误

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.18.0...v0.18.1

Page 19 of 22

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.