Put your chatbot in Telegram, Slack and Discord
The chatbot you built for your website can answer in Telegram, Slack and Discord too, with the same knowledge, tools and workflows. Setting up each takes a few minutes.
Before you start, build your chatbot and make it Live under Deploy. It answers in these apps only while it is Live. Everything else in this guide happens under Channels in your dashboard, in the app you are connecting, and, if your chatbot needs to know who the user is, in your own product.
Telegram
Your chatbot becomes a Telegram bot that people can find and message. It answers every message in a private chat, and in a group only when someone mentions it or replies to it.
In Telegram
- Open @BotFather and send
/newbot. - Choose a name, which people see, and a username ending in "bot", which is its address.
- BotFather replies with a token that looks like
123456789:ABC-DEF…. Copy it.
In ChatFrom
- Open your chatbot and go to Channels.
- Paste the token under Telegram and press Connect Telegram. ChatFrom checks the token and connects the bot straight away.
- Open the link it shows,
t.me/yourbot, and send a message to try it.
To stop, press Disconnect. The bot stays yours in Telegram, and you can delete it with BotFather.
Slack
Your chatbot becomes an app in your Slack workspace. People can message it directly, or mention it in a channel it has been invited to, where it answers in a thread. In a channel, every message to it has to mention it, a follow-up in the thread included.
In ChatFrom, then in Slack
- In ChatFrom, go to Channels and copy the app manifest shown under Slack. It already contains your chatbot's addresses and the permissions it needs.
- Open Slack's app page, choose From a manifest, pick your workspace and paste the manifest.
- Press Install to Workspace and allow it.
- Copy two values from the app's settings: the Bot User OAuth Token under OAuth & Permissions, which starts with
xoxb-, and the Signing Secret under Basic Information. - Back in ChatFrom, paste both under Slack and press Connect Slack.
- In Slack, open the app from the sidebar and send it a message to try it.
- To use it in a channel, invite it there first:
/invite @yourbot.
To stop, press Disconnect in ChatFrom, and remove the app in Slack's app settings if you no longer need it.
Discord
Your chatbot becomes a Discord bot. Add it to your community's server and people can mention it in any channel it can read, or reply to one of its answers, and it answers there. Anyone who shares a server with it can also message it directly.
In Discord
- Open Discord's developer portal, press New Application and give it your chatbot's name. The icon you set there becomes the bot's picture.
- Under Bot, turn on Message Content Intent. Without it Discord hides what people write to the bot, and ChatFrom says so on the Channels page.
- Still under Bot, press Reset Token and copy the token.
In ChatFrom
- Paste the token under Discord and press Connect Discord. ChatFrom checks it and brings the bot online within a minute.
- Press Add it to a server, pick your server and allow it. The link asks only for what the bot needs: to read the channels it is in, send messages and read their history.
- In Discord, mention the bot in a channel, or message it directly, to try it.
To stop, press Disconnect in ChatFrom. The bot leaves no data behind in ChatFrom, and you can delete the application in the developer portal.
When your chatbot needs to know the user
Many chatbots only answer questions, and for those you are done. If yours also acts for a signed-in user, for example to show their projects or create one, it needs to know who is writing. On your website, the widget already carries your signed-in user's token to your tool server. In Telegram, Slack and Discord there is no page to carry it, so each user links their account once.
How it works for your users
- In a private chat with the bot, they send
/connectin Telegram, orconnectin a direct message in Slack or Discord. In a group, a channel or a server the bot points them to a private chat instead, so nobody else sees the link. - The bot answers with a button to a page on your site.
- They sign in to your product as usual, and confirm that the chat is theirs.
- From then on, the chatbot acts as that signed-in user, exactly as it does in the widget on your website.
They can send /disconnect or disconnect at any time to unlink.
What to add to your product
You need one new page. Your tool server does not change: it receives the same token, in the same header, as it does from the widget.
- A page that requires sign-in, for example
https://yourapp.com/connect-chatfrom. The button in the chat opens it with?chatfrom_code=…added. - Show who is asking. Ask ChatFrom who the code belongs to, and show it with a confirm button, such as "Connect Telegram @anna to your account?".
- When they confirm, send the code to ChatFrom with the same kind of token your site gives the widget for that user.
ChatFrom answers { "linked": true }, and the user gets a message in their chat that their account is linked. account is optional: it is how your product names the account, shown back to the user. A code works once and for fifteen minutes; after that, both calls answer 404 and the user sends connect again.
Let your coding agent build it
If you work with a coding agent such as Claude Code, Cursor or Copilot, copy this prompt into it inside your product's code. It builds the page, reuses the token your widget already gets, and tells you the address to enter in ChatFrom. The same prompt is on the Channels page in your dashboard, with your chatbot's name filled in.
Add a "Connect your chat account" page to our app, so users can link their Telegram, Slack or Discord chat with our ChatFrom chatbot to their account here. ChatFrom already sends our signed-in users' token to our tool server from the website widget; this page lets a Telegram, Slack or Discord user hand over the same token once, so the chatbot can act for them in the chat too.
How the flow works:
1. In Telegram, Slack or Discord, the user sends "connect" to the bot. The bot replies with a button to our page: https://<your app>/connect-chatfrom?chatfrom_code=<code>. The code is one-time and expires after 15 minutes.
2. Our page requires the user to be signed in, using our normal login. If they are not signed in, send them to log in and bring them back to this page with the chatfrom_code kept.
3. Our server asks ChatFrom who the code belongs to:
GET https://chatfrom.io/api/channels/link/<code>
200: { "chatbot": "...", "channel": "telegram" | "slack" | "discord", "display_name": "@anna", "expires_at": "..." }
404: { "error": "..." } (unknown, used or expired code)
4. Show a confirmation, for example: "Connect Telegram @anna to your account <their email>?" with a "Yes, connect" button and a "Cancel" link. This step is required: without it, someone could send their own code to another person and link that person's account without them noticing.
5. When they confirm, our server links the account:
POST https://chatfrom.io/api/channels/link/<code>
Content-Type: application/json
{ "user_token": "<token for this user>", "account": "<how we name the account, e.g. their email>" }
200: { "linked": true, "channel": "...", "display_name": "..." }
404: the code has expired or was already used; tell the user to send "connect" again in the chat.
400: user_token is missing or not URL-safe.
6. Show a result page: "Linked. You can go back to the chat." The user also gets a message in the chat.
Requirements:
- user_token must be the same kind of token we already give the ChatFrom widget as data-user-token for this user (reuse the function that makes it). ChatFrom never decodes it; it sends it as the X-User-Id header to our tool server (MCP), which already knows how to check it. Do not change the tool server.
- The token can be at most 1024 characters of A-Z, a-z, 0-9 and . _ ~ -.
- Choose its lifetime on purpose. If our widget tokens expire quickly, issue a longer-lived one here, because a linked chat keeps using it until the user unlinks, and the user has to link again when it expires. Our tool server should still reject it when the account is deleted or signed out everywhere.
- Call both ChatFrom endpoints from our server, not from the browser. Never put the token in a URL or log it.
- Protect the confirm POST against cross-site request forgery, as with every other form in our app.
- Treat a 404 from either call as "link expired" with a friendly page, not an error.
- Match the look of our other account pages. No new dependencies unless we already use them.
When it is done:
- Tell me the page's full address, so I can enter it in ChatFrom under Channels, "Your link page".
- Add a short test for the confirm step and for the expired-code case, in the style of our existing tests.
- Explain how to try it: send /connect to the Telegram bot (or "connect" to the Slack app or the Discord bot in a direct message), open the button, sign in, confirm, and check the chat says the account is linked.In ChatFrom
Under Channels, enter your page's address in Your link page and save. Until you do, the bot tells users that it does not link accounts, and it keeps answering general questions.
Two things to decide
- Keep the confirm step, and guard it. It lets the user check that the chat is really theirs. Without it, someone could send their own code to another person and have that person link it to their account without noticing. Protect the confirm request against cross-site requests like every form on your site, or a page that submits the code by itself gets past the confirmation.
- Choose how long the token lasts. If the tokens you give the widget expire after an hour, a linked chat stops acting for the user after an hour and they have to link again. For chat links, issue a token that lasts as long as you are happy for a linked chat to act for the user, and reject it on your server when the user signs out everywhere or deletes their account.
What your users can do
| In Telegram | In Slack | In Discord | What it does |
|---|---|---|---|
| Any message | A direct message, or a mention in a channel | A direct message, or a mention or reply in a server | Asks the chatbot |
| /new | new | new | Starts a new conversation |
| /connect | connect | connect | Links their account on your site, in a private chat |
| /disconnect | disconnect | disconnect | Unlinks it |
Everything else works as on your website. The chatbot answers from your knowledge, uses your tools, hands off to a person, and counts towards your monthly allowance. When a workflow asks the user to pick something, the options appear as buttons. A conversation continues for a day, and every conversation appears under Conversations, marked with the app it came from.
Privacy
The Telegram bot, the Slack app and the Discord bot belong to you, in your own account with each service. Messages pass through that service on your behalf, so name them in your own privacy policy, next to ChatFrom. What ChatFrom keeps is described in our privacy policy and our data processing agreement.