<div align="center">
# NoneBot-Adapter-DoDo
_✨ DoDo 协议适配 ✨_
</div>
## 配置
修改 NoneBot 配置文件 `.env` 或者 `.env.*`。
### Driver
参考 [driver](https://nonebot.dev/docs/appendices/config#driver) 配置项,添加 `HTTPClient` 和 `WebSocketClient` 支持。
如:
```dotenv
DRIVER=~aiohttp
# 或
DRIVER=~httpx+~websockets
```
### DODO_BOTS
> 暂只支持 `WebSocket` 连接, `WebHook` 开发中,请先使用 WebSocket 连接模式
从[DoDo开放平台](https://doker.imdodo.com/)创建机器人,获取 `client_id` 和 `token`,并在配置文件中配置机器人帐号列表。如:
```dotenv
DODO_BOTS='
[
{
"client_id": "xxx",
"token": "xxx"
}
]
'
```
## 使用
### 支持消息段
可收发:
- `MessageSegment.text` 文本(支持[Markdown](https://open.imdodo.com/dev/api/message.html#markdon%E8%AF%AD%E6%B3%95))
- `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开放平台](https://doker.imdodo.com/)。
Raw data
{
"_id": null,
"home_page": "https://github.com/nonebot/adapter-dodo",
"name": "nonebot-adapter-dodo",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "nonebot, dodo, bot",
"author": "CMHopeSunshine",
"author_email": "277073121@qq.com",
"download_url": "https://files.pythonhosted.org/packages/29/10/5f4a04e0e0cd35d52b4ebe5a5583d6407245a5f26ff5a767cc9f3ad0db6d/nonebot_adapter_dodo-0.2.1.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n\n# NoneBot-Adapter-DoDo\n\n_\u2728 DoDo \u534f\u8bae\u9002\u914d \u2728_\n\n</div>\n\n## \u914d\u7f6e\n\n\u4fee\u6539 NoneBot \u914d\u7f6e\u6587\u4ef6 `.env` \u6216\u8005 `.env.*`\u3002\n\n### Driver\n\n\u53c2\u8003 [driver](https://nonebot.dev/docs/appendices/config#driver) \u914d\u7f6e\u9879\uff0c\u6dfb\u52a0 `HTTPClient` \u548c `WebSocketClient` \u652f\u6301\u3002\n\n\u5982\uff1a\n\n```dotenv\nDRIVER=~aiohttp\n# \u6216\nDRIVER=~httpx+~websockets\n```\n\n\n### DODO_BOTS\n\n> \u6682\u53ea\u652f\u6301 `WebSocket` \u8fde\u63a5\uff0c `WebHook` \u5f00\u53d1\u4e2d\uff0c\u8bf7\u5148\u4f7f\u7528 WebSocket \u8fde\u63a5\u6a21\u5f0f\n\n\u4ece[DoDo\u5f00\u653e\u5e73\u53f0](https://doker.imdodo.com/)\u521b\u5efa\u673a\u5668\u4eba\uff0c\u83b7\u53d6 `client_id` \u548c `token`\uff0c\u5e76\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u914d\u7f6e\u673a\u5668\u4eba\u5e10\u53f7\u5217\u8868\u3002\u5982\uff1a\n\n```dotenv\nDODO_BOTS='\n[\n {\n \"client_id\": \"xxx\",\n \"token\": \"xxx\"\n }\n]\n'\n```\n\n## \u4f7f\u7528\n\n### \u652f\u6301\u6d88\u606f\u6bb5\n\n\u53ef\u6536\u53d1\uff1a\n\n- `MessageSegment.text` \u6587\u672c(\u652f\u6301[Markdown](https://open.imdodo.com/dev/api/message.html#markdon%E8%AF%AD%E6%B3%95))\n- `MessageSegment.at_user` @\u7528\u6237\n- `MessageSegment.channel_link` \u8df3\u8f6c\u9891\u9053\n- `MessageSegment.reference` \u5f15\u7528(\u56de\u590d)\u6d88\u606f\n- `MessageSegment.picture` \u56fe\u7247\n- `MessageSegment.video` \u89c6\u9891\n- `MessageSegment.card` \u5361\u7247\u6d88\u606f\n\n> \u53d1\u9001\u56fe\u7247\u548c\u89c6\u9891\u6240\u9700\u8981\u7684 url \u90fd\u5fc5\u987b\u4e3a\u5b98\u65b9 url\n> \u56fe\u7247\u53ef\u901a\u8fc7 `Bot.set_resouce_picture_upload` \u63a5\u53e3\u6765\u4e0a\u4f20\u56fe\u7247bytes\uff0c\u8fd4\u56de\u7ed3\u679c\u4e2d\u7684 `url` \u5373\u4e3a\u53d1\u9001\u6240\u9700\u7684 url\u3002\n> \u89c6\u9891\u5c1a\u672a\u63d0\u4f9b\u4e0a\u4f20\u63a5\u53e3\uff0c\u56e0\u6b64\u53ea\u80fd\u4e0a\u4f20\u6765\u81ea\u5e73\u53f0\u4e8b\u4ef6\u4e2d\u5e26\u6709\u7684\u5b98\u65b9\u89c6\u9891 url\u3002\n\n> \u56fe\u7247\u548c\u89c6\u9891\u53ea\u80fd\u5355\u72ec\u53d1\u9001\uff0c\u4e0d\u80fd\u548c\u5176\u4ed6\u6d88\u606f\u6bb5\u4e00\u8d77\u53d1\u9001\u3002\u5361\u7247\u6d88\u606f\u53ef\u4ee5\u548c\u6587\u672c\u6d88\u606f\u6bb5\u4e00\u8d77\u53d1\u9001\u3002\n\n\u4ec5\u652f\u6301\u63a5\u6536\uff1a\n\n- `type:at_role`: \u827e\u7279\u8eab\u4efd\u7ec4\n- `type:at_all`: \u827e\u7279\u6240\u6709\u4eba\n- `type:share`: \u5206\u4eab\u6d88\u606f\n- `type:file`: \u6587\u4ef6\u6d88\u606f\n- `type:red_packet`: \u7ea2\u5305\u6d88\u606f\n\n### \u652f\u6301\u4e8b\u4ef6\n\n- `ChannelMessageEvent` \u9891\u9053\u6d88\u606f\u4e8b\u4ef6\n- `MessageReactionEvent` \u6d88\u606f\u8868\u60c5\u53cd\u5e94\u4e8b\u4ef6\n- `CardMessageButtonClickEvent` \u5361\u7247\u6d88\u606f\u6309\u94ae\u70b9\u51fb\u4e8b\u4ef6\n- `CardMessageFormSubmitEvent` \u5361\u7247\u6d88\u606f\u8868\u5355\u56de\u4f20\u4e8b\u4ef6\n- `CardMessageListSubmitEvent` \u5361\u7247\u6d88\u606f\u5217\u8868\u56de\u4f20\u4e8b\u4ef6\n- `ChannelVoiceMemberJoinEvent` \u6210\u5458\u52a0\u5165\u8bed\u97f3\u9891\u9053\u4e8b\u4ef6\n- `ChannelVoiceMemberLeaveEvent` \u6210\u5458\u9000\u51fa\u8bed\u97f3\u9891\u9053\u4e8b\u4ef6\n- `ChannelArticleEvent` \u5e16\u5b50\u53d1\u5e03\u4e8b\u4ef6\n- `ChannelArticleCommentEvent` \u5e16\u5b50\u8bc4\u8bba\u56de\u590d\u4e8b\u4ef6\n- `MemberJoinEvent` \u6210\u5458\u52a0\u5165\u4e8b\u4ef6\n- `MemberLeaveEvent` \u6210\u5458\u79bb\u5f00\u4e8b\u4ef6\n- `MemberInviteEvent` \u6210\u5458\u9080\u8bf7\u4e8b\u4ef6\n- `GiftSendEvent` \u8d60\u793c\u6210\u529f\u4e8b\u4ef6\n- `IntegralChangeEvent` \u79ef\u5206\u53d8\u66f4\u4e8b\u4ef6\n- `GoodsPurchaseEvent` \u5546\u54c1\u8d2d\u4e70\u6210\u529f\u4e8b\u4ef6\n- `PersonalMessageEvent` \u79c1\u4fe1\u4e8b\u4ef6\n\n\u652f\u6301\u7684 API \u5217\u8868\u8bf7\u53c2\u8003 [DoDo\u5f00\u653e\u5e73\u53f0](https://doker.imdodo.com/)\u3002\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Dodo adapter for nonebot2",
"version": "0.2.1",
"project_urls": {
"Documentation": "https://github.com/nonebot/adapter-dodo",
"Homepage": "https://github.com/nonebot/adapter-dodo",
"Repository": "https://github.com/nonebot/adapter-dodo"
},
"split_keywords": [
"nonebot",
" dodo",
" bot"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "972e3c58d87711498cf104cb076ef478cd68504e33425b0bd2d9f126db11befe",
"md5": "0ac30be58f036f11c2dc3e6f408fb7e8",
"sha256": "c388991bf1fc642a8328147d09d1445fc427ec915af873af031315be3ebb9eb7"
},
"downloads": -1,
"filename": "nonebot_adapter_dodo-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0ac30be58f036f11c2dc3e6f408fb7e8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 20858,
"upload_time": "2024-03-25T02:23:32",
"upload_time_iso_8601": "2024-03-25T02:23:32.324958Z",
"url": "https://files.pythonhosted.org/packages/97/2e/3c58d87711498cf104cb076ef478cd68504e33425b0bd2d9f126db11befe/nonebot_adapter_dodo-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "29105f4a04e0e0cd35d52b4ebe5a5583d6407245a5f26ff5a767cc9f3ad0db6d",
"md5": "51e41c7c4aa1a0273ae921d4950b4638",
"sha256": "ad37ae0cbd807afcb83eacb37f5d50593d437ce077ba720541a53551eaeac675"
},
"downloads": -1,
"filename": "nonebot_adapter_dodo-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "51e41c7c4aa1a0273ae921d4950b4638",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 18947,
"upload_time": "2024-03-25T02:23:33",
"upload_time_iso_8601": "2024-03-25T02:23:33.916476Z",
"url": "https://files.pythonhosted.org/packages/29/10/5f4a04e0e0cd35d52b4ebe5a5583d6407245a5f26ff5a767cc9f3ad0db6d/nonebot_adapter_dodo-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-25 02:23:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nonebot",
"github_project": "adapter-dodo",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "nonebot-adapter-dodo"
}