Skip to content

feat: 支持飞书语音消息发送 (Feishu audio message support) #33736

@hadiliu

Description

@hadiliu

功能描述

希望在飞书 channel 中支持发送语音消息,而不是作为文件附件。

使用场景

  • TTS 生成的语音可以直接作为语音气泡发送,用户无需下载即可播放
  • 情报播报、语音提醒等场景更加友好

技术方案

飞书语音消息需要:

  1. 音频格式转换为 OPUS:ffmpeg -i input.mp3 -acodec libopus -ac 1 -ar 16000 output.opus
  2. 上传文件获取 file_key:POST /open-apis/im/v1/files (file_type=opus)
  3. 发送消息:msg_type: audio, content 包含 file_key

参考文档:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create

期望实现

message tool 新增支持:

{
  "action": "send",
  "channel": "feishu",
  "type": "audio",
  "file": "/path/to/audio.mp3"
}

或新增 tts 动作直接发送语音气泡:

{
  "action": "tts",
  "channel": "feishu",
  "text": "语音内容"
}

相关信息

  • 飞书语音消息格式要求:opus
  • 文件大小限制:30MB
  • 需要权限:im:resource

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions