Add AI to chats: guest bots, streaming and chat automation
What it is
Since May 2026, anyone can call a Guest Mode bot into any private or group chat by tagging its @username, even if it isn't a member. Streaming shows the answer as it's generated; chat automation lets people connect your bot to their profile to reply for them.
How to do it
- In @BotFather's Mini App, open your bot's settings and enable Guest Mode; `getMe` then shows `supports_guest_queries`.
- A tag, or a reply to the bot, brings a `guest_message` update with `guest_query_id` and any replied-to message.
- Reply once with `answerGuestQuery`, passing the `guest_query_id` and a `result`… Reply once with `answerGuestQuery`, passing the `guest_query_id` and a `result` shaped like an inline result; it returns a `SentGuestMessage`.
- Streaming, in private chats: repeat `sendMessageDraft` with one `draft_id` as… Streaming, in private chats: repeat `sendMessageDraft` with one `draft_id` as text grows (empty text shows "Thinking…"), then send the final `sendMessage`. With `can_stop`, a Stop tap brings `stopped_message_generation`.
- Chat automation: enable Secretary Mode in @BotFather; people connect the bot in… Chat automation: enable Secretary Mode in @BotFather; people connect the bot in Settings › Chat Automation and choose its chats.
Watch out
- A guest bot sees only the message that tags it and replies to it: no history, no member list, nothing more until it's tagged or replied to again.
- One reply per interaction; up to 3 guest bots per message.
- A draft is a temporary 30-second preview, up to 4,096 characters; only `sendMessage` keeps the answer.
- Developer Terms, Section 4.3, prohibit collecting data for datasets, machine-learning models or AI products, such as scraping groups and channels.
With Gem
Gem doesn't offer guest mode, streaming or chat automation for your bot. Nearby: @gembot answers in your project's groups, and Gem apps get the `gem` library (`gem.ask`, `gem.kb`, `gem.event`; docs at apps.gem.bot/docs).
Sources
- https://core.telegram.org/bots/features#guest-bots
- https://core.telegram.org/bots/api#answerguestquery
- https://telegram.org/blog/ai-bot-revolution-11-new-features
- https://telegram.org/tos/bot-developers