feat: Add Telegram voice message receiving support #1948
+21
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概述 / Overview
Implements Telegram voice message receiving. Adapter now captures voice messages via
filters.VOICE, downloads OGG/Opus audio from Telegram API, and converts toplatform_message.Voicecomponents with base64 encoding for LLM processing.实现电报语音消息接收。适配器现在通过
filters.VOICE捕获语音消息,从 Telegram API 下载 OGG/Opus 音频,并转换为带有 base64 编码的platform_message.Voice组件供 LLM 处理。Changes / 更改
File:
src/langbot/pkg/platform/sources/telegram.py(+21 lines)Message handler filter - Added
filters.VOICEto capture voice messagesVoice processing in
target2yiri()- Downloads voice file, extracts MIME type, encodes to base64:Technical Notes / 技术说明
Voicecomponents as file contentpython-telegram-botandaiohttp更改前后对比截图 / Screenshots
检查清单 / Checklist
PR 作者完成 / For PR author
项目维护者完成 / For project maintainer
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.