← 返回
沟通协作 Key

feishu-video

Send voice/audio messages to Feishu (Lark) users. Converts audio files to OPUS format and sends as voice message, not file attachment. create by Alex
向飞书用户发送语音消息,将音频文件转换为OPUS格式并以语音形式发送(非文件附件)。
yangmiok
沟通协作 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 529
下载
💾 6
安装
1
版本
#latest

概述

Feishu Audio Message Skill

This skill enables sending voice messages (not file attachments) to Feishu/Lark users via the Open API.

When to Use

Use this skill when:

  • User wants to send a voice message to Feishu
  • User wants to convert and send audio (MP3, WAV, etc.) as a voice message
  • User specifies they want audio message, not file upload

Requirements

  1. ffmpeg - Required for audio conversion to OPUS format
  2. Node.js 18+ - For running the send script
  3. Feishu App Credentials:
    • App ID
    • App Secret
    • Target user's Open ID

How It Works

  1. Convert audio to OPUS - Feishu requires audio in OPUS format
  2. Upload audio file - Upload to Feishu with file_type: opus and duration
  3. Send audio message - Send with msg_type: audio

Usage

Step 1: Convert Audio to OPUS

ffmpeg -i input.mp3 -c:a libopus -b:a 32k output.opus

Step 2: Get Audio Duration

ffprobe -v quiet -show_format -print_format json input.mp3
# Look for "duration" field in output

Step 3: Run the Script

node scripts/send-voice.mjs \
  --app-id "cli_xxx" \
  --app-secret "xxx" \
  --user-id "ou_xxx" \
  --audio-file "audio.opus" \
  --duration 3480

Or use environment variables:

export FEISHU_APP_ID="cli_xxx"
export FEISHU_APP_SECRET="xxx"
node scripts/send-voice.mjs --user-id "ou_xxx" --audio-file "audio.opus" --duration 3480

API Details

1. Get Tenant Access Token

POST https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal

2. Upload Audio File

POST https://open.feishu.cn/open-apis/im/v1/files
Content-Type: multipart/form-data

file_type: opus
file_name: voice.opus
duration: <milliseconds>
file: <binary>

3. Send Audio Message

POST https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id

{
  "receive_id": "ou_xxx",
  "msg_type": "audio",
  "content": "{\"file_key\":\"file_v3_xxx\"}"
}

Important Notes

  • Audio MUST be OPUS format - MP3/WAV will fail
  • Duration is in milliseconds
  • The app must have Bot capability enabled
  • Rate limit: 5 QPS per user/chat

Example Output

🎤 开始发送语音消息到飞书...

📁 音频文件: /path/to/voice.opus
⏱️  时长: 3480ms

✅ 获取 Tenant Access Token 成功
✅ 上传语音文件成功, file_key: file_v3_00uh_xxx
✅ 发送语音消息成功!
消息 ID: om_x100b5731827e6ca4b10d48c15dfa3ab

🎉 完成!

Troubleshooting

ErrorSolution
-----------------
file type not supportConvert to OPUS format
duration is requiredAdd duration parameter
permission deniedCheck app has messaging scope
user not foundVerify user Open ID

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-20 02:05 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

Gmail

byungkyu
Gmail API 集成,托管 OAuth,支持读取、发送和管理邮件、线程、标签及草稿,适用于需要与 Gmail 交互的场景。
★ 72 📥 37,725
communication-collaboration

Slack

steipete
当需要通过 slack 工具从 Clawdbot 控制 Slack 时使用,包括在频道或私信中回复消息或置顶/取消置顶项目。
★ 157 📥 47,678
communication-collaboration

imap-smtp-email

gzlicanyi
使用IMAP/SMTP读取和发送邮件;检查新/未读邮件、获取内容、搜索邮箱、标记已读/未读、发送带附件的邮件。支持...
★ 114 📥 52,408