Skip to content

[Bug]Discord 适配器(Adapter)没有针对 Voice Message 做特殊映射 #7580

@dongfangxiyu

Description

@dongfangxiyu

What happened / 发生了什么

给Discord bot发私聊语音消息,Astrbot控制台输出如下:
[2026-04-15 20:49:05.118] [Core] [INFO] [core.event_bus:61]: [Discord_bot] [discord(discord)] Yuri Thomson/581457745358749708: [ComponentType.File]
[2026-04-15 20:49:05.527] [Core] [ERRO] [v4.23.1] [agent_sub_stages.internal:386]: Error occurred while processing agent: Server disconnected

在 Discord 的底层 API 中,语音消息是一个格式为 .ogg 的文件附件 (Attachment)。目前 AstrBot 的 Discord 适配器并没有像 QQ 那样做特殊处理把它转化为“语音”类型(ComponentType.Record),而是把它当成了一个普通的“文件 (File)”(ComponentType.File)。

因为消息类型被判定为 File 而不是 Record,AstrBot 直接跳过了 STT 解析流程。

因为跳过了 STT,AstrBot进入了准备发给大模型处理的阶段。
它试图把这个音频文件当作普通附件上传给我的大模型 API。

由于格式不支持或代理节点对这种文件流媒体上传支持不佳,连接被 API 服务器掐断,于是报了 Server disconnected。

Reproduce / 如何复现?

1.接入Discord bot
2.配置好stt模型
3.在Discord配置文件中启用STT
4.在Discord移动端app给bot发私聊语音消息
5.观察Astrbot控制台输出

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

4.23.1,Docker Compose,MiMo STT,Discord适配器

OS

Linux

Logs / 报错日志

[2026-04-15 20:49:05.118] [Core] [INFO] [core.event_bus:61]: [Discord_bot] [discord(discord)] Yuri Thomson/581457745358749708: [ComponentType.File]
[2026-04-15 20:49:05.527] [Core] [ERRO] [v4.23.1] [agent_sub_stages.internal:386]: Error occurred while processing agent: Server disconnected

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • Yes!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:platformThe bug / feature is about IM platform adapter, such as QQ, Lark, Telegram, WebChat and so on.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions