跨平台太复杂?不同的适配器区别太大?saa 太难不会用?
别担心,nonebot-plugin-segbuilder
将是你的不二之选!
nonebot-plugin-segbuilder
是帮助开发者快速构建跨平台消息段的应用的工具。相较于 saa (nonebot-plugin-send-anything-anywhere) 包办了消息构建与发送,本插件仅实现了消息段构建,更加符合 NoneBot2 原生的编写流程,同时也更易拓展与理解。
但与之相对的,面对与 QQ 消息类型相差越大的平台,这种发送方式的兼容性也会越差,而本插件由于仅负责了消息段构建而不少问题是发送时才会抛出,因此本插件的使用体验下限将远低于 saa。但如果你能接受一定程度的平台相关处理或仅在类 qq 的平台(如 OB11 和 OB12),本插件的上限也将高于 saa。
屑屑 msgbuf 的 README(https://github.com/NCBM/nonebot-plugin-msgbuf)
- ✅: 完全支持
- 🟨: 部分支持,由于平台限制需要用户额外分平台处理
- 🚧: 临时不支持,但后续可能会修复
- ❌: 永久不支持,通常是平台不支持此功能或实现过于复杂
- 🔧: 预期支持
Adapters | Text | image | at(@) | reply(quote) | face | voice | video | file | share | location |
---|---|---|---|---|---|---|---|---|---|---|
OneBot V11 | ✅ | ✅ | ✅ | ✅ | 🔧 | 🔧 | 🔧 | 🔧 | 🔧 | 🔧 |
OneBot V12 | ✅ | ✅ | ✅ | ✅ | 🔧 | 🔧 | 🔧 | 🔧 | 🔧 | 🔧 |
mirai2 | ✅ | ✅ | ✅ | 🚧 | 🔧 | 🔧 | 🔧 | 🔧 | 🔧 | 🔧 |
qqguild | ✅ | ✅ | ✅ | 🚧 | 🔧 | ❌ | ❌ | ❌ | ❌ | ❌ |
对于不支持的适配器,将会统一转为文字回复
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-segbuilder
打开 nonebot2 项目根目录下的 pyproject.toml
文件, 在 [tool.nonebot]
部分去掉本插件, 否则小概率可能造成加载失败
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-segbuilder
pdm
pdm add nonebot-plugin-segbuilder
poetry
poetry add nonebot-plugin-segbuilder
conda
conda install nonebot-plugin-segbuilder
在此感谢以下开发者(项目)对本项目做出的贡献:
- nonebot-plugin-send-anything-anywhere: 项目的灵感来源以及部分实现的参考
- nonebot-plugin-template: 项目的 README 模板