Telegram
Connect Telegram to Fabric Agents — create a bot with @BotFather, paste the token, and drive sessions from any chat with the bot.
Telegram uses the official Bot API. You create a bot through Telegram's @BotFather, paste the token into Fabric Agents, and every DM to your bot drives a session.
1. Create a bot
-
Open Telegram and message @BotFather.
-
Send
/newbot. -
Pick a display name (what shows up in chats) and a username (must end in
bot, e.g.my_fabric_bot). -
BotFather replies with a token that looks like:
123456789:AAH...long-string...xyz -
Copy that token. Don't share it — it's the full credential for the bot.
Optional but recommended — still chatting with BotFather:
-
/setdescription— shown in the bot's profile. -
/setuserpic— upload an avatar. -
/setcommands— preload the slash commands Fabric Agents supports, so Telegram auto-completes them:new - Create a new session and bind this chat bind - Pick from recent sessions pair - Redeem a 6-digit pairing code status - Show the session bound to this chat stop - Abort the current agent run unbind - Disconnect this chat from its session help - List available commands
2. Connect Telegram in Fabric Agents
- Open Fabric Agents → Settings → Messaging.
- Click Connect on the Telegram row.
- Paste the token.
- Click Test connection — you should see a green check and your bot's username.
- Click Save.
The token is stored in your OS keychain. Telegram now shows as connected and is listening for messages.
3. Start a session from your phone
Open Telegram, search for the bot's username (the one ending in bot), and send:
/helpThe bot replies with the command list. Then:
/new my first agentA new session appears in your workspace sidebar. Every subsequent message you send in that Telegram chat flows into the agent; replies come back in the chat.
4. Attachments
Telegram supports sending files to the agent. The bot accepts any of:
| Type | Max size | Delivered to the agent as |
|---|---|---|
| Photo | 20 MB | Image attachment on the next turn |
| Document | 20 MB | File attachment (raw bytes + filename) |
| Voice note | 20 MB | Audio file the agent can transcribe via its own tools |
| Video | 20 MB | Video file |
| Audio | 20 MB | Audio file |
Caption text sent with an attachment is treated as the user's message for that turn.
5. Response modes
Default is progress — one evolving message per run. Change it in Settings → Messaging → ⋯ on the binding row → Response mode.
See Messaging overview — response modes for details.
6. Adding the bot to a group
Telegram bots can be added to groups, but Fabric Agents is tuned for DMs — only direct messages currently drive sessions. Group messages are ignored.
Reconfigure or disconnect
- Reconfigure — Settings → Messaging → ⋯ on Telegram row → Reconfigure. Paste a new token (e.g. after you rotate via
/revokein BotFather). - Disconnect — same menu → Disconnect. The bot stops polling; bindings are preserved, so reconnecting later resumes them.
Troubleshooting
"Not a valid bot" — the token is wrong or the bot was deleted. Re-issue with /token in BotFather or create a fresh bot.
Messages aren't reaching the agent — check Settings → Messaging. The Telegram row should show "Connected as @yourbot". If it shows "Disconnected", click Connect and test again.
Bot stops responding after a while — Telegram revokes tokens if another poller connects with the same token. Make sure you're not running two Fabric Agents instances (or any other bot framework) with the same token.
Auto-reconnect after failures — when Telegram polling stops for any reason (most commonly a 409 Conflict from a second instance grabbing the same token), Fabric Agents now schedules a reconnect with exponential backoff: 30s for 409 (so the competing process has time to exit), 5s for other errors, capped at 5 minutes. You don't need to click Connect manually — the gateway tries on its own and resumes routing as soon as Telegram accepts polling again. If reconnect keeps failing, the messaging-gateway.log records a warn line (adapter_not_connected) the moment the gateway drops a session event, so the underlying outage isn't silent.
Related
- Messaging overview — response modes, bindings, workspace scoping
- Command reference — every slash command
- WhatsApp setup — alternative platform