docs/en/platform/telegram.md
Version v4.15.0.
| Message Type | Receive Support | Send Support | Notes |
|---|---|---|---|
| Text | Yes | Yes | |
| Image | Yes | Yes | |
| Voice | Yes | Yes | |
| Video | Yes | Yes | |
| File | Yes | Yes |
Proactive message push: Supported.
First, open Telegram and search for BotFather. Click Start, then send /newbot and follow the prompts to enter your bot's name and username.
After successful creation, BotFather will provide you with a token. Please keep it secure.
If you need to use the bot in group chats, you must disable the bot's Privacy mode. Send the /setprivacy command to BotFather, select your bot, and then choose Disable.
Bots in the left sidebar+ Create BottelegramFill in the configuration fields that appear:
token.Please ensure your network environment can access Telegram. You may need to configure a proxy using Configuration -> Other Settings -> HTTP Proxy.
The Telegram platform supports streaming output. Enable the "Streaming Output" switch in "AI Configuration" -> "Other Settings".
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.
In group chats, since the sendMessageDraft API only supports private chats, AstrBot automatically falls back to the traditional send_message + edit_message_text approach.
:::warning
sendMessageDraft requires python-telegram-bot>=22.6.
:::