Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit de3eeb1

Browse files
authored
Merge pull request #160 from AstrBotDevs/docs-agent/AstrBotDevs-AstrBot-pr-5726
文档更新:Telegram 平台新增流式输出功能说明
2 parents b939038 + 4a3b3c9 commit de3eeb1

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

en/platform/telegram.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,20 @@ Fill in the configuration fields that appear:
3636
- Enable: Check this option.
3737
- Bot Token: Your Telegram bot's `token`.
3838

39-
Please ensure your network environment can access Telegram. You may need to configure a proxy using `Configuration -> Other Settings -> HTTP Proxy`.
39+
Please ensure your network environment can access Telegram. You may need to configure a proxy using `Configuration -> Other Settings -> HTTP Proxy`.
40+
41+
## Streaming Output
42+
43+
The Telegram platform supports streaming output. Enable the "Streaming Output" switch in "AI Configuration" -> "Other Settings".
44+
45+
### Private Chat Streaming
46+
47+
In private chats, AstrBot uses the `sendMessageDraft` API (added in Telegram Bot API v9.3) for streaming output. This displays a "typing" draft preview animation in the chat interface, creating a more natural "typewriter" effect. It avoids issues with the traditional approach such as message flickering, push notification interference, and API edit frequency limits.
48+
49+
### Group Chat Streaming
50+
51+
In group chats, since the `sendMessageDraft` API only supports private chats, AstrBot automatically falls back to the traditional `send_message` + `edit_message_text` approach.
52+
53+
:::warning
54+
`sendMessageDraft` requires `python-telegram-bot>=22.6`.
55+
:::

zh/platform/telegram.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,20 @@
3737
- 启用(enable): 勾选。
3838
- Bot Token: 你的 Telegram 机器人的 `token`
3939

40-
请确保你的网络环境可以访问 Telegram。你可能需要使用 `配置页->其他配置->HTTP 代理` 来设置代理。
40+
请确保你的网络环境可以访问 Telegram。你可能需要使用 `配置页->其他配置->HTTP 代理` 来设置代理。
41+
42+
## 流式输出
43+
44+
Telegram 平台支持流式输出。需要在「AI 配置」->「其他配置」中开启「流式输出」开关。
45+
46+
### 私聊流式输出
47+
48+
在私聊中,AstrBot 使用 Telegram Bot API v9.3 新增的 `sendMessageDraft` API 实现流式输出。这种方式会在私聊界面展示一个「正在输入」的草稿预览动画,体验更接近「打字机」效果,且避免了传统方案的消息闪烁、推送通知干扰和 API 编辑频率限制等问题。
49+
50+
### 群聊流式输出
51+
52+
在群聊中,由于 `sendMessageDraft` API 仅支持私聊,AstrBot 会自动回退到传统的 `send_message` + `edit_message_text` 方案。
53+
54+
:::warning
55+
`sendMessageDraft` 功能需要 `python-telegram-bot>=22.6`
56+
:::

0 commit comments

Comments
 (0)