Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

适配 DoDo #114

Merged
merged 6 commits into from
Nov 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,31 @@ assert deserialized_target == target

### 支持的 adapter

| OneBot v11 | OneBot v12 | QQ Guild | Kaiheila | Telegram | Feishu | Red |
| :--------: | :--------: | :------: | :------: | :------: | :----: | :-: |
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| OneBot v11 | OneBot v12 | QQ Guild | Kaiheila | Telegram | Feishu | Red | DoDo |
| :--------: | :--------: | :------: | :------: | :------: | :----: | :-: | :--: |
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |

### 支持的消息类型

| | OneBot v11 | OneBot v12 | QQ Guild | 开黑啦 | Telegram | Feishu | Red |
| :--: | :--------: | :--------: | :------: | :----: | :------: | :----: | :-: |
| 文字 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 图片 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| at | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 回复 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 🚧 |
| | OneBot v11 | OneBot v12 | QQ Guild | 开黑啦 | Telegram | Feishu | Red | DoDo |
| :--: | :--------: | :--------: | :------: | :----: | :------: | :----: | :-: | :--: |
| 文字 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 图片 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| at | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 回复 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 🚧 | ✅ |

### 支持的发送目标

| | OneBot v11 | OneBot v12 | QQ Guild | Kaiheila | Telegram | Feishu | Red |
| :--------------------: | :--------: | :--------: | :------: | :------: | :------: | :----: | :-: |
| QQ 群 | ✅ | ✅ | | | | | ✅ |
| QQ 私聊 | ✅ | ✅ | | | | | ✅ |
| QQ 频道子频道消息 | | ✅ | ✅ | | | | |
| QQ 频道私聊 | | ✅ | ✅ | | | | |
| 开黑啦私聊/频道 | | | | ✅ | | | |
| Telegram 普通对话/频道 | | | | | ✅ | | |
| 飞书私聊/群聊 | | | | | | ✅ | |
| | OneBot v11 | OneBot v12 | QQ Guild | Kaiheila | Telegram | Feishu | Red | DoDo |
| :--------------------: | :--------: | :--------: | :------: | :------: | :------: | :----: | :-: | :--: |
| QQ 群 | ✅ | ✅ | | | | | ✅ | |
| QQ 私聊 | ✅ | ✅ | | | | | ✅ | |
| QQ 频道子频道消息 | | ✅ | ✅ | | | | | |
| QQ 频道私聊 | | ✅ | ✅ | | | | | |
| 开黑啦私聊/频道 | | | | ✅ | | | | |
| Telegram 普通对话/频道 | | | | | ✅ | | | |
| 飞书私聊/群聊 | | | | | | ✅ | | |
| DoDo 私聊/群聊 | | | | | | | | ✅ |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

私聊的 TODO 是啥

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啥?

@register_list_targets(adapter)
async def list_targets(bot: BaseBot) -> List[PlatformTarget]:
assert isinstance(bot, BotDodo)
targets = []
for island in await bot.get_island_list():
for channel in await bot.get_channel_list(
island_source_id=island.island_source_id
):
targets.append(TargetDoDoChannel(channel_id=channel.channel_id))
# TODO: 私聊
return targets

这个是 auto_select_bot 的


注:对于使用 Onebot v12,但是没有专门适配的发送目标,使用了 TargetOB12Unknow 来保证其可以正常使用

Expand Down
Loading