Telegram integration uses the standard Bot API via a bot token you create with @BotFather. There’s no account linking — you talk to your bot, and the bot drives a Craft Agent session.Documentation Index
Fetch the complete documentation index at: https://agents.craft.do/docs/llms.txt
Use this file to discover all available pages before exploring further.
Create a Bot
Create a new bot
Send
/newbot and follow the prompts. Give it a display name and a username (must end in bot, e.g. my_craft_agent_bot).Copy the token
BotFather replies with a line like:This is your bot token. Treat it like a password — anyone with it can impersonate your bot.
Connect in the App
Open Settings → Messaging
In Craft Agent, open Settings → Messaging. You’ll see a tile for each supported platform.
Paste the token and click Test
Craft Agent calls Telegram’s
getMe endpoint. On success you’ll see the bot’s name and username; on failure you’ll see Telegram’s error message verbatim.First Conversation
Open your bot in Telegram
Tap the
t.me/<your_bot_username> link BotFather sent you, or search for your bot’s username.Send /new
This creates a new session in your active workspace and binds the chat to it. You’ll get a reply like:
Attachments
Send a photo, document, voice message, video, or audio file and the gateway downloads the blob, wraps it as aFileAttachment, and forwards it to the session alongside your caption.
| Type | Forwarded as |
|---|---|
| Photo | Image attachment (original resolution) |
| Document | File attachment with original MIME type |
| Voice | Audio attachment (ogg/opus) |
| Video | Video attachment |
| Audio | Audio attachment |
Inline Buttons
Telegram supports inline keyboard buttons, so flows like/bind render a tappable list of recent sessions instead of a numbered text list:
Webhook vs Long-Poll
- In-app (desktop Electron): the adapter uses long-poll (grammY’s built-in updater). No public URL needed.
- Headless server: the adapter uses webhook mode. You configure a public URL (e.g.,
https://your-server.tld/telegram/webhook), register it withsetWebhook, and Telegram posts updates to it. The server verifies theX-Telegram-Bot-Api-Secret-Tokenheader.
Troubleshooting
Bot replies with 'No session bound to this chat'
Bot replies with 'No session bound to this chat'
This is expected on the first message to a fresh bot. Send
/new to create and bind a session, or /pair <code> to redeem a pairing code from the app.Test fails with '401 Unauthorized'
Test fails with '401 Unauthorized'
Bot receives messages but nothing happens
Bot receives messages but nothing happens
Check that the workspace the bot is configured in is the active workspace in the app. Each workspace has its own messaging config — a bot registered under workspace A won’t drive sessions in workspace B.
Messages in a group don't work
Messages in a group don't work
By design — only private DMs with the bot can drive a session. Group and channel messages are rejected at the adapter boundary.
Attachment 'too large' reply
Attachment 'too large' reply
Telegram’s Bot API caps file downloads at 20 MB. Upload the file via the app’s attachment picker instead, or split it.