← Back to Skills Marketplace
54meteor

Feishu Voice API Sender

by 退役前写代码的 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
101
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install feishu-voice-api-sender
Description
飞书语音消息发送:使用官方 API 上传 OPUS 音频并发送语音消息,解决 OpenClaw 内置发送缺少 duration 参数的问题。| Send voice messages via Feishu official API, fixing OpenClaw's missing duration param...
README (SKILL.md)

Feishu Voice Send Skill

功能

通过飞书官方 API 发送语音消息,解决 OpenClaw 内置发送缺少 duration 参数的问题。

核心问题

OpenClaw 内置的飞书媒体发送存在 bug:

  • uploadFileFeishu 缺少 duration 参数
  • sendFileFeishu 发送 audio 消息时 content 缺少 duration

飞书官方 API 要求:

  • 上传 opus 文件时必须提供 duration(毫秒)
  • 发送 audio 消息时 content 必须包含 file_keyduration

本 skill 直接调用飞书官方 API,绕过 OpenClaw 内置函数的 bug。

使用方式

方式一:发送现有音频文件

python3 /mnt/d/wslspace/workspace/skills/feishu-voice-send/scripts/send_voice.py \x3C音频文件路径> \x3C接收者open_id>

方式二:直接生成 TTS 并发送

python3 /mnt/d/wslspace/workspace/skills/feishu-voice-send/scripts/tts_and_send.py "要转换的文字" \x3C接收者open_id>

核心脚本

send_voice.py

直接发送现有的 .ogg 音频文件:

python3 scripts/send_voice.py \x3Cogg文件路径> \x3Copen_id>

tts_and_send.py

  1. 用 edge-tts 生成 TTS(mp3)
  2. 用 ffmpeg 转换为标准 Ogg Opus
  3. 自动获取 duration
  4. 调用官方 API 发送语音消息
python3 scripts/tts_and_send.py "文字内容" \x3Copen_id> [-v voice] [-r rate]

参数:

  • 文字内容(必须):要转换的文字
  • open_id(必须):接收者飞书 open_id
  • -v voice:TTS 音色,默认 zh-CN-YunjianNeural
  • -r rate:语速,默认 -10%(即90%速度)

示例

发送音频文件

python3 scripts/send_voice.py /path/to/audio.ogg \x3C接收者open_id>

发送 TTS 语音

python3 scripts/tts_and_send.py "你好,这是语音测试。" \x3C接收者open_id>

使用不同音色和语速

python3 scripts/tts_and_send.py "Hello world" \x3C接收者open_id> -v en-US-EmmaNeural -r 0

技术说明

关键问题

OpenClaw 内置的飞书媒体发送存在 bug:

  • uploadFileFeishu 缺少 duration 参数
  • sendFileFeishu 发送 audio 消息时 content 缺少 duration

飞书官方 API 要求:

  • 上传 opus 文件时必须提供 duration(毫秒)
  • 发送 audio 消息时 content 必须包含 file_keyduration

解决方案

直接调用飞书官方 API,不走 OpenClaw 内置函数:

  1. 获取 tenant_access_token
  2. 上传 opus 文件(带 duration)
  3. 发送 audio 类型消息(content 包含 file_key 和 duration)

依赖

  • Python 3
  • requests
  • ffprobe(ffmpeg 的一部分)
  • edge-tts(通过 uvx 运行)

凭证配置

脚本从以下途径获取飞书凭证(优先级从高到低):

方式一:环境变量(推荐)

设置环境变量,最灵活:

# 在终端中设置
export APP_ID="cli_xxxxxxxxxxxxxx"
export APP_SECRET="xxxxxxxxxxxxxxxxxxxxxxxx"

# 或直接运行
APP_ID="cli_xxxxxxxxxxxxxx" APP_SECRET="xxxxxxxx" python3 scripts/send_voice.py ...

方式二:OpenClaw 配置(自动)

如果脚本在 OpenClaw 环境下运行,会自动从 ~/.openclaw/openclaw.json 读取 main 账号的凭证。

方式三:手动修改脚本

如果以上方式都不适用,可以直接在脚本开头修改:

APP_ID = "cli_xxxxxxxxxxxxxx"
APP_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxx"

注意:方式三会随 skill 更新丢失,不推荐。

获取飞书应用凭证

  1. 前往 飞书开放平台 创建应用
  2. 获取应用的 App IDApp Secret
  3. 配置应用权限(需要 im:message 相关权限)
  4. 将机器人添加到飞书群或与用户单聊
Usage Guidance
This skill appears to do exactly what it says: generate/convert audio, compute duration, and call Feishu APIs using an app ID/secret. Before installing, consider: - Provide APP_ID and APP_SECRET via environment variables (recommended) instead of editing scripts. The scripts will read ~/.openclaw/openclaw.json as a fallback, so verify that file's contents and be aware the skill will try to open it. - The scripts invoke external binaries (uvx/edge-tts and ffmpeg/ffprobe). Make sure you trust those tools and that they are installed from trusted sources. - The code performs network calls to open.feishu.cn (expected). If you need stronger isolation, run the scripts in a sandboxed environment or review/modify the code to restrict file reads. - Note the minor metadata mismatch: registry metadata lists no required env vars/binaries while SKILL.md and scripts do. This is probably a packaging/documentation oversight, not malicious, but verify runtime requirements before use.
Capability Analysis
Type: OpenClaw Skill Name: feishu-voice-api-sender Version: 1.0.1 The skill sends Feishu voice messages by directly interacting with the Feishu API to bypass reported bugs in OpenClaw's built-in functions. It exhibits several high-risk behaviors: it reads sensitive credentials (App ID/Secret) from the OpenClaw configuration file (~/.openclaw/openclaw.json), executes external binaries (ffmpeg, ffprobe) via subprocess, and uses 'uvx' to dynamically fetch and execute the 'edge-tts' package. While these actions are aligned with the stated purpose in SKILL.md and scripts/tts_and_send.py, the combination of credential access, shell execution, and remote artifact execution warrants a suspicious classification per the security threshold.
Capability Assessment
Purpose & Capability
Name/description, scripts, and SKILL.md all describe sending Opus audio to Feishu and adding the required duration field. Requested binaries (ffprobe/ffmpeg, edge-tts via uvx) and use of APP_ID/APP_SECRET are consistent with generating/converting audio and calling Feishu APIs. Minor mismatch: registry metadata listed no required env vars/binaries while SKILL.md and scripts do list them.
Instruction Scope
Runtime instructions and scripts only perform TTS (via uvx/edge-tts), audio conversion (ffmpeg/ffprobe), read credentials (env vars or ~/.openclaw/openclaw.json), and call Feishu API endpoints. These actions stay within the stated purpose. Note: the skill explicitly reads ~/.openclaw/openclaw.json as a credential fallback — this grants it access to any data in that file and may expose other OpenClaw-stored credentials if present.
Install Mechanism
No install spec; this is instruction + script only. The package does not download remote archives or run an installer. External binaries (uvx, ffmpeg/ffprobe) are invoked at runtime and must already be present; that is normal for this functionality.
Credentials
The scripts require Feishu application credentials (APP_ID and APP_SECRET) which are appropriate and necessary to obtain tenant_access_token and call Feishu APIs. The code also falls back to reading ~/.openclaw/openclaw.json for credentials — justified for running inside OpenClaw but increases the file-scope the skill can access. No other unrelated secret env vars or credentials are requested.
Persistence & Privilege
always is false and the skill does not modify other skills or system-wide config. It does not request persistent installation privileges; it only runs scripts on invocation.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install feishu-voice-api-sender
  3. After installation, invoke the skill by name or use /feishu-voice-api-sender
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
修复 edge-tts --rate 参数格式问题,从 --rate xxx 改为 --rate=xxx
v1.0.0
首次发布:使用官方 API 发送飞书语音消息,凭证从环境变量或 OpenClaw 配置读取
Metadata
Slug feishu-voice-api-sender
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Feishu Voice API Sender?

飞书语音消息发送:使用官方 API 上传 OPUS 音频并发送语音消息,解决 OpenClaw 内置发送缺少 duration 参数的问题。| Send voice messages via Feishu official API, fixing OpenClaw's missing duration param... It is an AI Agent Skill for Claude Code / OpenClaw, with 101 downloads so far.

How do I install Feishu Voice API Sender?

Run "/install feishu-voice-api-sender" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Feishu Voice API Sender free?

Yes, Feishu Voice API Sender is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Feishu Voice API Sender support?

Feishu Voice API Sender is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Feishu Voice API Sender?

It is built and maintained by 退役前写代码的 (@54meteor); the current version is v1.0.1.

💬 Comments