# Send Telegram Voice Group to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "telegram-voice-group",
    "name": "Telegram Voice Group",
    "source": "tencent",
    "type": "skill",
    "category": "通讯协作",
    "sourceUrl": "https://clawhub.ai/sanwecn/telegram-voice-group",
    "canonicalUrl": "https://clawhub.ai/sanwecn/telegram-voice-group",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/telegram-voice-group",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=telegram-voice-group",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "DEPENDENCIES.md",
      "FEATURES.md",
      "README.md",
      "SKILL.md",
      "TELEGRAM_TOPICS.md",
      "USE_CASES.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "telegram-voice-group",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-01T13:19:32.670Z",
      "expiresAt": "2026-05-08T13:19:32.670Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=telegram-voice-group",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=telegram-voice-group",
        "contentDisposition": "attachment; filename=\"telegram-voice-group-0.1.5.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "telegram-voice-group"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/telegram-voice-group"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/telegram-voice-group",
    "downloadUrl": "https://openagent3.xyz/downloads/telegram-voice-group",
    "agentUrl": "https://openagent3.xyz/skills/telegram-voice-group/agent",
    "manifestUrl": "https://openagent3.xyz/skills/telegram-voice-group/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/telegram-voice-group/agent.md"
  }
}
```
## Documentation

### Telegram 群组语音消息发送 (telegram-voice-group) 🔊

使用 Telegram 群组话题功能实现隔离上下文替代 Discord，并可以指定 Telegram 群组发送语音消息。

### 功能

使用 Microsoft Edge-TTS 生成高质量中文语音
转换为 Telegram 语音气泡兼容格式
发送到指定的群组会话
话题独立上下文：每个 Telegram 话题都有独立的会话上下文，格式为 agent:main:telegram:group:{groupId}:topic:{threadId}
会话隔离：不同话题间的对话历史和上下文完全隔离，互不干扰，这使得 Telegram 群组话题功能可以有效替代 Discord 频道的组织功能
支持向特定话题发送语音消息

### 依赖

edge-tts - 用于生成语音
ffmpeg - 用于格式转换

### 1. 创建 Telegram 群组

打开 Telegram 应用
点击右上角的 "+" 按钮
选择 "新建群组" 或 "New Group"
添加成员并设置群组名称和头像

### 2. 邀请 OpenClaw Bot 到群组

在群组中点击群组名称进入群组信息页面
点击 "添加成员" 或 "Add Member"
搜索并选择你的 OpenClaw Bot（例如 @your_openclaw_bot）
点击 "添加" 或 "Add"

### 3. 赋予 OpenClaw Bot 群组管理权限

在群组信息页面，点击 OpenClaw Bot 的用户名
选择 "提升为管理员" 或 "Promote to Admin"
授予以下权限：

删除消息 (Delete Messages)
编辑群组信息 (Edit Group Info)
发送消息 (Send Messages)
发送媒体 (Send Media)
限制成员 (Restrict Members)
封禁成员 (Ban Members)
添加管理员 (Add Admins) - 可选，根据需要

### 4. 获取群组的链接和 ID

点击群组头像进入群组信息页面
点击 "群组类型" 或 "Group Type" 下方的 "群组链接" 或 "Group Link"
复制群组链接（例如 https://t.me/your_group_name）
群组 ID 通常是链接后面的部分，或者在某些客户端可以直接看到数字 ID

### 5. 创建话题并获取话题序号

在群组中，点击底部的 "+" 按钮
选择 "新建话题" 或 "Create Topic"（如果群组启用了话题功能）
设置话题名称
点击话题头像进入话题详情
查看邀请链接，链接末尾的数字即为话题序号（例如 https://t.me/your_group_name/123 中的 123）

### 6. 在 OpenClaw 中配置群组和话题

将群组链接和 ID 发送给 OpenClaw Bot
将话题序号发送给 OpenClaw Bot
使用如下命令格式发送语音消息：
向 agent:main:telegram:group:[GROUP_ID]:topic:[TOPIC_ID] 发送语音: 你的语音内容

### 1. 直接在会话中使用此功能：

"向 {群组会话键} 发送语音: {语音内容}"

例如:
"向 agent:main:telegram:group:[GROUP_ID]:topic:[TOPIC_ID] 发送语音: 大家好，我是[ASSISTANT_NAME]，[NICKNAME]的AI助理。很高兴在[MOLTBOT_COMMUNITY]社区与大家见面，祝大家交流愉快！"

### 2. 通过 sessions_spawn 调用：

await sessions_spawn({
  task: "向 agent:main:telegram:group:[GROUP_ID]:topic:[TOPIC_ID] 发送语音: 这是一条测试消息",
  agentId: "telegram-voice-group"
})

### 3. 直接调用函数（在JS环境中）：

const { sendVoiceToTelegramGroup } = require('./index.js');
await sendVoiceToTelegramGroup({
  text: "语音内容",
  groupId: "agent:main:telegram:group:[GROUP_ID]:topic:[TOPIC_ID]",
  voice: "zh-CN-XiaoxiaoNeural",
  rate: "+5%"
});

### 4. 向特定话题发送语音消息：

可通过 threadId 参数向特定话题发送语音消息：

const { message } = require('@openclaw/core');

await message({
  action: 'send',
  channel: 'telegram',
  to: '[GROUP_ID]',
  message: '语音消息内容',
  asVoice: true,
  media: '语音文件路径',
  threadId: [TOPIC_ID]  // 指定话题ID
});

### 5. 使用函数发送到指定话题：

const { sendVoiceToTelegramGroup } = require('./index.js');
await sendVoiceToTelegramGroup({
  text: "语音内容",
  groupId: "agent:main:telegram:group:[GROUP_ID]:topic:[TOPIC_ID]",
  voice: "zh-CN-XiaoxiaoNeural",
  rate: "+5%",
  threadId: [TOPIC_ID]  // 可选：指定话题ID
});

### 实现逻辑

当检测到用户请求向群组发送语音消息时，系统将自动执行以下步骤：

使用 edge-tts 生成语音文件
edge-tts --voice zh-CN-XiaoxiaoNeural --rate=+5% --text "语音内容" --write-media /tmp/voice_msg.mp3



使用 ffmpeg 转换为 Telegram 兼容格式
ffmpeg -y -i /tmp/voice_msg.mp3 -c:a libopus -b:a 48k -ac 1 -ar 48000 -application voip /tmp/voice_msg.ogg



使用 message 工具发送语音文件到指定群组
message({action: 'send', channel: 'telegram', to: '[GROUP_ID]', message: '', asVoice: true, media: '/tmp/voice_msg.ogg', threadId: [TOPIC_ID]})

### 参数

语音内容: 要转换为语音的文本
群组会话键: 目标群组的完整会话键

### 技术规范

生成 MP3 格式临时音频
使用 FFmpeg 转换为 Telegram 兼容的 OGG Opus 格式
音频参数：libopus编码，48k比特率，单声道，48kHz采样率，VOIP应用类型
使用 asVoice: true 参数确保以语音气泡形式发送，而非文件
自动清理临时文件
文本格式清洗：自动移除 Markdown 标记、URL 链接和特殊符号，避免朗读出标记符号

### 文本格式清洗

为避免朗读出标记符号，技能会自动清洗文本内容：

需移除示例Markdown 标记**加粗**、\`代码\`、# 标题URL 链接https://example.com特殊符号---、***、>>>

### 完全替代 Discord 的能力

话题独立上下文：每个 Telegram 话题都有独立的会话上下文，格式为 agent:main:telegram:group:{groupId}:topic:{threadId}
会话隔离：不同话题间的对话历史和上下文完全隔离，互不干扰
模型独立设置：可以在不同的话题中设置不同的 AI 模型
上下文独立：每个话题维护自己的对话历史，就像 Discord 的不同频道一样

### 在不同话题中设置不同模型

通过 OpenClaw 的会话管理功能，可以为每个话题（agent:main:telegram:group:{groupId}:topic:{threadId}）单独配置 AI 模型
每个话题的上下文完全独立，不会相互影响
支持多话题并行运行，每个话题可以有不同的功能和配置

### 注意事项

机器人必须已在目标群组中
需要相应的消息发送权限
语音内容应适合群组环境
清洗后的文本将用于语音生成，确保朗读效果
每个 Telegram 话题都有独立的会话上下文，格式为 agent:main:telegram:group:{groupId}:topic:{threadId}
不同话题间的对话历史和上下文完全隔离，互不干扰，这使得 Telegram 群组话题功能可以有效替代 Discord 频道的组织功能
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: sanwecn
- Version: 0.1.5
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-01T13:19:32.670Z
- Expires at: 2026-05-08T13:19:32.670Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/telegram-voice-group)
- [Send to Agent page](https://openagent3.xyz/skills/telegram-voice-group/agent)
- [JSON manifest](https://openagent3.xyz/skills/telegram-voice-group/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/telegram-voice-group/agent.md)
- [Download page](https://openagent3.xyz/downloads/telegram-voice-group)