Alconna Adapter for Nonebot
Project description
NoneBot Plugin Alconna
✨ Alconna Usage For NoneBot2 ✨
✨ All Receive in One, And One Send All ✨
该插件提供了 Alconna 的 NoneBot2 适配版本与工具
特性
- 完整的 Alconna 特性支持
- 自动回复命令帮助信息选项
- 跨平台的接收与发送消息(被动+主动)
- 对20种适配器的收发消息支持
- 比
got-reject
更强大的补全会话机制 - 多种内置插件 (echo,help,lang)
- i18n 支持
讨论
QQ 交流群: 链接
使用方法
跨平台消息
from nonebot import get_driver
from nonebot_plugin_alconna import Target, UniMessage, SupportScope, on_alconna
driver = get_driver()
test = on_alconna("test")
@test.handle()
async def handle_test():
r = await UniMessage.image(path="path/to/img").send()
if r.recallable:
await r.reply("图片已发送,10秒后撤回")
await r.recall(delay=10, index=0)
@test.got("foo", prompt=UniMessage.template("{:Reply($message_id)}请输入图片"))
async def handle_foo():
await test.send("图片已收到")
@driver.on_startup
async def _():
await Target.group("123456789", SupportScope.qq_client).send(UniMessage.image(path="test.png"))
支持情况
支持的适配器
协议名称 | 路径 |
---|---|
OneBot 协议 | adapters.onebot11, adapters.onebot12 |
Telegram | adapters.telegram |
飞书 | adapters.feishu |
GitHub | adapters.github |
QQ bot | adapters.qq |
钉钉 | adapters.ding |
Console | adapters.console |
开黑啦 | adapters.kook |
Mirai | adapters.mirai |
Ntchat | adapters.ntchat |
MineCraft | adapters.minecraft |
Walle-Q | adapters.onebot12 |
Discord | adapters.discord |
Red 协议 | adapters.red |
Satori | adapters.satori |
Dodo IM | adapters.dodo |
Kritor | adapters.kritor |
Tailchat | adapters.tailchat |
支持的消息元素
- ✅: 支持(接收和发送)
- ⬇️: 支持接收
- ⬆️: 支持发送
- ➖: 情况不存在
- ❌: 插件未支持
- 🚫: 协议未支持
- 🚧: 计划中或部分支持
[!WARNING] 斜体的协议名称意味着其协议或其适配器长时间未维护或已失效
元素\适配器 | OneBot V11 | OneBot V12 | Telegram | 飞书 | Github | QQ-API | 钉钉 | Console | 开黑啦 | Mirai | Ntchat | MineCraft | Discord | Red | Satori | Dodo IM | Kritor | Tailchat |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
文本 Text | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
样式文本 Styled Text | 🚫 | 🚫 | ✅ | 🚫 | ✅ | ✅ | ❌ | ✅ | ✅ | 🚫 | 🚫 | ✅ | 🚫 | 🚫 | ✅ | 🚫 | 🚫 | ✅ |
提及用户 At(user) | ✅ | ✅ | ✅ | ✅ | ⬆️ | ✅ | ✅ | 🚫 | ✅ | ✅ | ❌ | 🚫 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
提及角色 At(role) | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | ✅ | 🚫 | 🚫 | 🚫 | ✅ | 🚫 | ✅ | ✅ | 🚫 | 🚫 |
提及频道 At(channel) | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | ✅ | 🚫 | 🚫 | ✅ | 🚫 | 🚫 | 🚫 | ✅ | 🚫 | ✅ | ✅ | 🚫 | ✅ |
提交全体 AtAll | ✅ | ✅ | 🚫 | ✅ | 🚫 | ✅ | ✅ | 🚫 | ✅ | ✅ | 🚫 | 🚫 | ✅ | ✅ | ✅ | ✅ | ✅ | 🚫 |
表情 Emoji | ✅ | 🚫 | ✅ | 🚫 | 🚫 | ✅ | 🚫 | ✅ | ✅ | ✅ | 🚫 | 🚫 | ✅ | ✅ | 🚫 | 🚫 | ✅ | ✅ |
图片 Image | ✅ | ✅ | ✅ | ✅ | ⬆️ | ✅ | ✅ | 🚫 | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
音频 Audio | ⬆️ | ✅ | ✅ | ✅ | 🚫 | ✅ | 🚫 | 🚫 | ✅ | ⬆️ | ⬇️ | 🚫 | ⬆️ | ⬆️ | ✅ | 🚫 | ⬆️ | 🚫 |
语音 Voice | ✅ | ✅ | ✅ | ⬆️ | 🚫 | ⬆️ | 🚫 | 🚫 | ⬆️ | ✅ | ⬇️ | 🚫 | ⬆️ | ✅ | ⬆️ | 🚫 | ✅ | 🚫 |
视频 Video | ✅ | ✅ | ✅ | ✅ | 🚫 | ✅ | 🚫 | 🚫 | ✅ | ✅ | ✅ | 🚫 | ⬆️ | ✅ | ✅ | ✅ | ✅ | 🚫 |
文件 File | ⬇️ | ✅ | ✅ | ✅ | 🚫 | ✅ | 🚫 | 🚫 | ✅ | ✅ | ✅ | 🚫 | ⬆️ | ✅ | ✅ | ⬇️ | ⬇️ | ✅ |
回复 Reply | ✅ | ✅ | ✅ | ✅ | 🚫 | ✅ | 🚫 | 🚫 | ✅ | ✅ | ✅ | 🚫 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
引用转发 Reference | ✅ | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | ✅ | 🚫 | 🚫 | 🚫 | ✅ | ✅ | 🚫 | ✅ | 🚫 |
超级消息 Hyper | ✅ | 🚫 | 🚫 | ⬇️ | 🚫 | ✅ | 🚫 | 🚫 | ✅ | ✅ | ✅ | 🚫 | 🚫 | ✅ | 🚫 | 🚫 | ✅ | 🚫 |
按钮 Button | 🚫 | 🚫 | ⬆️ | 🚫 | 🚫 | ✅ | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | ⬆️ | ✅ | 🚫 | ✅ | 🚫 | ✅ | 🚫 |
其余 Other | ✅ | ✅ | ✅ | ✅ | ➖ | ✅ | ✅ | ➖ | ✅ | ✅ | ✅ | ➖ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
配置项
- ALCONNA_AUTO_SEND_OUTPUT : 是否全局启用输出信息自动发送
- ALCONNA_USE_COMMAND_START : 是否将 COMMAND_START 作为全局命令前缀
- ALCONNA_AUTO_COMPLETION: 是否全局启用补全会话功能
- ALCONNA_USE_ORIGIN: 是否全局使用原始消息 (即未经过 to_me 等处理的)
- ALCONNA_USE_PARAM: 是否使用特制的 Param 提供更好的依赖注入
- ALCONNA_USE_CMD_SEP: 是否将 COMMAND_SEP 作为全局命令分隔符
- ALCONNA_GLOBAL_EXTENSIONS: 全局加载的扩展, 路径以 . 分隔, 如 foo.bar.baz:DemoExtension
- ALCONNA_CONTEXT_STYLE: 全局命令上下文插值的风格,None 为关闭,bracket 为 {...},parentheses 为 $(...)
- ALCONNA_ENABLE_SAA_PATCH: 是否启用 SAA 补丁
- ALCONNA_APPLY_FILEHOST: 是否启用文件托管
- ALCONNA_APPLY_FETCH_TARGETS: 是否启动时拉取一次发送对象列表
- ALCONNA_BUILTIN_PLUGINS: 需要加载的alc内置插件集合
- ALCONNA_CONFLICT_RESOLVER: 命令冲突解决策略,default 为保留两个命令,raise 为抛出异常,ignore 为忽略新命令,replace 为替换旧命令
- ALCONNA_RESPONSE_SELF: 是否允许响应自己的消息
插件示例
# echo 插件
from nonebot_plugin_alconna import UniMessage, Command
@Command("echo <...content>").build(auto_send_output=True).handle()
async def _(content: UniMessage):
await content.finish()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nonebot_plugin_alconna-0.53.0.tar.gz
(142.7 kB
view details)
Built Distribution
File details
Details for the file nonebot_plugin_alconna-0.53.0.tar.gz
.
File metadata
- Download URL: nonebot_plugin_alconna-0.53.0.tar.gz
- Upload date:
- Size: 142.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.19.1 CPython/3.10.12 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 404289034a9d41a8fbdb5b50d8fe2b069234c4aaffe20ccf417871aeb91f8cff |
|
MD5 | 843e7283158db1260d322cd805b4e359 |
|
BLAKE2b-256 | 00299876b41c3b62809d0fbccdf11a1880291dee67e9cdf728eaa9d956d4a3d8 |
File details
Details for the file nonebot_plugin_alconna-0.53.0-py3-none-any.whl
.
File metadata
- Download URL: nonebot_plugin_alconna-0.53.0-py3-none-any.whl
- Upload date:
- Size: 197.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.19.1 CPython/3.10.12 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0351de37e9d55a92b4dbf2977815e9d0cfe700cab4f0dc345a80fe2883253a0 |
|
MD5 | 1af5623b9e689065f5f1b1881590f915 |
|
BLAKE2b-256 | 7406d8f0f6d1b15f75b280bd4c56ad9d3de72fb23564995cfab5fb014a44e400 |