Skip to content

Commit

Permalink
🐛 fix uniseg builder
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Jun 11, 2024
1 parent 8d7cc83 commit 9796e3d
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,39 @@ async def_():
| [Kritor](https://github.com/nonebot/adapter-kritor) | adapters.kritor |
| [Tailchat](https://github.com/eya46/nonebot-adapter-tailchat) | adapters.tailchat |

### 支持的消息元素

- ✅: 支持(接收和发送)
- ⬇️: 支持接收
- ⬆️: 支持发送
- ➖: 情况不存在
- ❌: 插件未支持
- 🚫: 协议未支持
- 🚧: 计划中或部分支持

> [!WARNING]
> 斜体的协议名称意味着其协议或其适配器长时间未维护或已失效
| 元素\适配器 | OneBot V11 | OneBot V12 | Telegram | 飞书 | Github | QQ-API | _钉钉_ | Console | 开黑啦 | Mirai | _Ntchat_ | MineCraft | _BiliBili Live_ | 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 || 🚫 | 🚫 | ⬇️ | 🚫 || 🚫 | 🚫 |||| 🚫 | 🚫 | 🚫 || 🚫 | 🚫 || 🚫 |
| 其余 Other ||||||||||||||||||||


## 配置项

- ALCONNA_AUTO_SEND_OUTPUT : 是否全局启用输出信息自动发送
Expand Down
4 changes: 2 additions & 2 deletions src/nonebot_plugin_alconna/uniseg/adapters/dodo/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from nonebot_plugin_alconna.uniseg.constraint import SupportAdapter
from nonebot_plugin_alconna.uniseg.builder import MessageBuilder, build
from nonebot_plugin_alconna.uniseg.segment import At, File, AtAll, Image, Reply
from nonebot_plugin_alconna.uniseg.segment import At, File, AtAll, Image, Reply, Video


class DodoMessageBuilder(MessageBuilder):
Expand Down Expand Up @@ -45,7 +45,7 @@ def picture(self, seg: PictureSegment):

@build("video")
def video(self, seg: VideoSegment):
return Image(url=seg.data["video"].url)
return Video(url=seg.data["video"].url)

@build("file")
def file(self, seg: FileSegment):
Expand Down
2 changes: 1 addition & 1 deletion src/nonebot_plugin_alconna/uniseg/adapters/kook/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def audio(self, seg: AudioSegment):
def file(self, seg: FileSegment):
return File(
id=seg.data["file_key"],
name=seg.data.get("file_name", seg.data.get("title")),
name=seg.data["title"] or seg.data["file_key"],
)

@build("quote")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def record(self, seg: VoiceSegment):

@build("file")
def file(self, seg: FileSegment):
return File(id=seg.data.get("file_id"), name=seg.data.get("name", "file.bin"), url=seg.data.get("url"))
return File(id=seg.data.get("id"), name=seg.data.get("name", "file.bin"), url=seg.data.get("url"))

@build("reply")
def reply(self, seg: ReplySegment):
Expand Down

0 comments on commit 9796e3d

Please sign in to comment.