Dodo adapter for nonebot2
Project description
NoneBot-Adapter-DoDo
✨ DoDo 协议适配 ✨
配置
修改 NoneBot 配置文件 .env 或者 .env.*。
Driver
参考 driver 配置项,添加 HTTPClient 和 WebSocketClient 支持。
如:
DRIVER=~aiohttp
# 或
DRIVER=~httpx+~websockets
DODO_BOTS
暂只支持
WebSocket连接,WebHook开发中,请先使用 WebSocket 连接模式
从DoDo开放平台创建机器人,获取 client_id 和 token,并在配置文件中配置机器人帐号列表。如:
DODO_BOTS='
[
{
"client_id": "xxx",
"token": "xxx"
}
]
'
使用
支持消息段
可收发:
MessageSegment.text文本(支持Markdown)MessageSegment.at_user@用户MessageSegment.channel_link跳转频道MessageSegment.reference引用(回复)消息MessageSegment.picture图片MessageSegment.video视频MessageSegment.card卡片消息
发送图片和视频所需要的 url 都必须为官方 url 图片可通过
Bot.set_resouce_picture_upload接口来上传图片bytes,返回结果中的url即为发送所需的 url。 视频尚未提供上传接口,因此只能上传来自平台事件中带有的官方视频 url。
图片和视频只能单独发送,不能和其他消息段一起发送。卡片消息可以和文本消息段一起发送。
仅支持接收:
type:at_role: 艾特身份组type:at_all: 艾特所有人type:share: 分享消息type:file: 文件消息type:red_packet: 红包消息
支持事件
ChannelMessageEvent频道消息事件MessageReactionEvent消息表情反应事件CardMessageButtonClickEvent卡片消息按钮点击事件CardMessageFormSubmitEvent卡片消息表单回传事件CardMessageListSubmitEvent卡片消息列表回传事件ChannelVoiceMemberJoinEvent成员加入语音频道事件ChannelVoiceMemberLeaveEvent成员退出语音频道事件ChannelArticleEvent帖子发布事件ChannelArticleCommentEvent帖子评论回复事件MemberJoinEvent成员加入事件MemberLeaveEvent成员离开事件MemberInviteEvent成员邀请事件GiftSendEvent赠礼成功事件IntegralChangeEvent积分变更事件GoodsPurchaseEvent商品购买成功事件PersonalMessageEvent私信事件
支持的 API 列表请参考 DoDo开放平台。
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_adapter_dodo-0.2.1.tar.gz.
File metadata
- Download URL: nonebot_adapter_dodo-0.2.1.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad37ae0cbd807afcb83eacb37f5d50593d437ce077ba720541a53551eaeac675
|
|
| MD5 |
51e41c7c4aa1a0273ae921d4950b4638
|
|
| BLAKE2b-256 |
29105f4a04e0e0cd35d52b4ebe5a5583d6407245a5f26ff5a767cc9f3ad0db6d
|
File details
Details for the file nonebot_adapter_dodo-0.2.1-py3-none-any.whl.
File metadata
- Download URL: nonebot_adapter_dodo-0.2.1-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c388991bf1fc642a8328147d09d1445fc427ec915af873af031315be3ebb9eb7
|
|
| MD5 |
0ac30be58f036f11c2dc3e6f408fb7e8
|
|
| BLAKE2b-256 |
972e3c58d87711498cf104cb076ef478cd68504e33425b0bd2d9f126db11befe
|