telegram-voice-group向指定 Telegram 群组发送语音消息
Install via ClawdBot CLI:
clawdbot install sanwecn/telegram-voice-group使用 Telegram 群组话题功能实现隔离上下文替代 Discord,并可以指定 Telegram 群组发送语音消息。
agent:main:telegram:group:{groupId}:topic:{threadId}edge-tts - 用于生成语音ffmpeg - 用于格式转换
向 agent:main:telegram:group:[GROUP_ID]:topic:[TOPIC_ID] 发送语音: 你的语音内容
"向 {群组会话键} 发送语音: {语音内容}"
例如:
"向 agent:main:telegram:group:[GROUP_ID]:topic:[TOPIC_ID] 发送语音: 大家好,我是[ASSISTANT_NAME],[NICKNAME]的AI助理。很高兴在[MOLTBOT_COMMUNITY]社区与大家见面,祝大家交流愉快!"
await sessions_spawn({
task: "向 agent:main:telegram:group:[GROUP_ID]:topic:[TOPIC_ID] 发送语音: 这是一条测试消息",
agentId: "telegram-voice-group"
})
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 参数向特定话题发送语音消息:
const { message } = require('@openclaw/core');
await message({
action: 'send',
channel: 'telegram',
to: '[GROUP_ID]',
message: '语音消息内容',
asVoice: true,
media: '语音文件路径',
threadId: [TOPIC_ID] // 指定话题ID
});
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 --voice zh-CN-XiaoxiaoNeural --rate=+5% --text "语音内容" --write-media /tmp/voice_msg.mp3
ffmpeg -y -i /tmp/voice_msg.mp3 -c:a libopus -b:a 48k -ac 1 -ar 48000 -application voip /tmp/voice_msg.ogg
message({action: 'send', channel: 'telegram', to: '[GROUP_ID]', message: '', asVoice: true, media: '/tmp/voice_msg.ogg', threadId: [TOPIC_ID]})
asVoice: true 参数确保以语音气泡形式发送,而非文件为避免朗读出标记符号,技能会自动清洗文本内容:
| 需移除 | 示例 |
|--------|------|
| Markdown 标记 | 加粗、` 代码 、# 标题` |
| URL 链接 | https://example.com |
| 特殊符号 | ---、***、>>> |
agent:main:telegram:group:{groupId}:topic:{threadId}agent:main:telegram:group:{groupId}:topic:{threadId})单独配置 AI 模型agent:main:telegram:group:{groupId}:topic:{threadId}Generated Mar 1, 2026
AI assistants use this skill to send voice announcements or welcome messages in Telegram group topics, enhancing engagement in community discussions. Each topic acts like a separate channel, allowing targeted voice updates for different sub-communities or events without cross-talk.
Businesses deploy this skill to provide automated voice responses in Telegram support groups, where each topic handles a specific issue or customer query. It enables personalized, voice-based replies while maintaining isolated conversation histories for efficient support management.
Educators and trainers use the skill to distribute voice lessons or announcements in Telegram study groups, with topics organizing content by subject or class. This allows for segmented voice messaging to different student groups, mimicking classroom setups.
Teams leverage this skill to send voice updates on project progress in Telegram work groups, using topics for different projects or departments. It facilitates clear, audible notifications while keeping contexts separate to avoid confusion across projects.
Event organizers employ the skill to broadcast voice reminders or updates in Telegram event groups, with topics for various aspects like schedules or logistics. This ensures timely, voice-based communication tailored to specific event segments.
Offer this skill as part of a subscription-based AI assistant platform, charging monthly fees for access to voice messaging features in Telegram groups. Revenue comes from tiered plans based on usage limits or number of topics managed.
Provide bespoke integration services to businesses wanting to deploy this skill in their Telegram workflows, such as setting up topic-based voice systems for support or internal communications. Revenue is generated through one-time setup fees and ongoing maintenance contracts.
Release a free version with basic voice messaging capabilities and monetize through premium features like advanced voice customization, higher message limits, or priority support. Revenue streams include upgrades and in-app purchases for enhanced functionality.
💬 Integration Tip
Ensure the OpenClaw bot has admin permissions in the Telegram group and test voice generation with edge-tts locally before deployment to avoid format issues.
Turn your AI into JARVIS. Voice, wit, and personality — the complete package. Humor cranked to maximum.
Local Voice Input/Output for Agents using the AI Voice Agent API.
Transcribe audio files using OpenAI's gpt-4o-mini-transcribe model with vocabulary hints and text replacements. Requires uv (https://docs.astral.sh/uv/).
本地生成 Telegram 语音消息,支持自动清洗、分段与临时文件管理。
Speak responses aloud on macOS using the built-in `say` command when user input indicates Voice Wake/voice recognition (for example, messages starting with "User talked via voice recognition on <device>").
Generate Russian male voice audio using ComfyUI with Qwen3 TTS node and save as MP3 for voice messages.