Home · Help · Connecting Telegram

Connecting Telegram

Connecting takes five minutes and doesn't require your own server: you create a bot in @BotFather and paste the token in the “Channels” section — CHBT sets up the webhook to app.chbt.io on its own. Below are the steps in order, how to make sure everything works, and what to do if the channel status is “Error”.

Step 1. Create a bot in @BotFather

  1. Open @BotFather in Telegram and send the /newbot command.
  2. Enter the bot’s name — what customers will see in the chat header (“Mint Salon”). You can change it later with the /setname command.
  3. Enter a username — in Latin letters, ending in bot: myata_salon_bot. It becomes part of the link https://t.me/myata_salon_bot and can’t be changed, so choose carefully.
  4. BotFather replies with a message containing a token like 1234567890:AAH…. Copy all of it.

The token is the bot’s password: whoever has it controls the bot. Don’t forward it in chats or publish it; if it leaks, use /revoke in BotFather and get a new token. For details, see the help article on the BotFather token. If you already have a bot (it ran in another service or on your own code), you don’t need to create a new one — its token will work, and its subscribers and link are kept.

Step 2. Paste the token in “Channels”

  1. In the app.chbt.io dashboard, open the bot → the “Channels” section → in the “Connect a new channel” block, click “Connect” on the Telegram card.
  2. Optionally, fill in “Channel name” for your own reference (for example, “Main bot”), paste the token into the “Token” field, and click “Connect Telegram”.
  3. CHBT checks the token with a request to Telegram and sets up the webhook with a secret key on its own — you don't need to enter a URL manually, and the dashboard has no field for it.

After that, the dashboard opens the bot's “Overview”: a Telegram row with a status appears in the “Channels” card. “Working” means Telegram accepted the webhook, and you can move on to testing. “Error” means Telegram's response is shown next to it. “Unauthorized” means Telegram doesn't recognize the token: it was copied incompletely or has already been revoked. “Not Found” means the field contains something other than a token, such as a link to the bot. Connect Telegram again with a valid token, and delete the row with the error in “Channels”: the “⋯” button → “Delete”. It has no conversations — the bot never worked through it.

If the bot previously worked in another service, that service will stop responding: a bot has only one webhook. This is normal and means the switch has taken place.

Step 3. Test from your phone

  1. Open “Flows”: the card of the flow you need should show the “Enabled” badge, not “Draft”. You enable a flow with the toggle on its card or in the flow list on the “Overview” page. A new empty flow and a copy are created as drafts.
  2. Open the flow in the editor and check that it has the “Command (/start)” trigger.
  3. Open the link https://t.me/your_bot on your phone and tap “Start” (that’s the /start command).
  4. The bot should reply with the first message of the flow. In the dashboard, open “Conversations” — your conversation in the Telegram channel appears there.

If the message is in “Conversations” but there’s no reply, the connection is fine and the problem is in the flow. If the bot replied with “We can't reply in this chat right now”, the connection is fine too: on the Free plan, 30 distinct contacts have already messaged the bot this month. Conversations with them continue, but new contacts get this reply, and their messages don’t appear in “Conversations”. If there’s neither a message nor a reply, go back to the channel status. The “Check flow” button in the editor helps you quickly tell one case from the other: the test chat works without Telegram.

“Reinstall webhook” and the error email

CHBT doesn’t run a separate background check of the webhook: the channel status changes only in response to events. The status becomes “Working” when Telegram accepts the webhook during connection or reinstallation, and when an incoming message arrives from the bot; after a successful send on behalf of the bot, “Error” also changes back to “Working”. The status becomes “Error” when connection or reinstallation fails, and when Telegram rejects the token while sending a bot reply, an operator message or a broadcast. If another service has taken over the webhook, the status won’t reflect it — check “Conversations”.

The “Reinstall webhook” button is in the channel’s row in the “Channels” section. It re-checks the token saved in the channel and sets the webhook again to the CHBT address with the secret key already stored in the channel. It doesn’t change the token. Click it if:

  • the bot was also running on your own code or in another service, and that service took over the webhook — “Conversations” is empty while the status is “Working”. First stop the old code or remove the token from that service, otherwise it will take the webhook back;
  • the status is “Error”, but the message isn’t about the token (for example, a network error when contacting Telegram), and you’re sure the token is valid.

If Telegram responds with 401 when sending — the token was revoked or replaced in @BotFather — the channel row switches to “Error” with the message “bot token rejected (401 Unauthorized)”, and the bot’s owner and admins receive an email “Your bot … needs attention”: no more than once a day, and only if “Email notifications” or the “Bot status” option isn’t turned off in “Notifications”. “Reinstall webhook” won’t help here — the button works with the old token. Connect Telegram again with the new token and wait for the new row to show “Working”. You can delete the old row (“⋯” button → “Delete”): the messages that went through it will stay in “Conversations” as read-only. Contacts keep their tags and fields. You can no longer reply in those conversations — when the customer writes again, the conversation continues through the new row.

For the full checklist of reasons a bot goes silent, see the help article “Telegram bot not responding”; for a breakdown by symptom, see the article why a Telegram bot doesn’t respond.

What's next

You can run the same flow in MAX and VK by connecting those channels in the same section — nothing needs to be redone. Entry points for customers: the link https://t.me/your_bot, a link with the ?start=… parameter, and a QR code from the “QR campaigns” section. The parameter is caught by the “Deeplink” trigger: you can create a separate flow for it and mark the source there with the “Add a tag” action. Channel features are described on the Telegram bot page; if you don't have a bot in any service yet, start with the article on how to create a Telegram bot. Telegram is included in the Free plan — sign up and connect your bot in five minutes.

FAQ

Do I need to set the webhook manually?
No. When you click “Connect Telegram”, CHBT sets up the webhook with a secret key itself. There’s no separate URL field in the dashboard; if something goes wrong, use the “Reinstall webhook” button.

Can I connect a bot that is already working in another service?
Yes, with the same token. Once it's connected to CHBT, the previous service stops responding — a bot has only one webhook. Subscribers and the t.me link stay the same.

“Error” status with a message about 401 or Unauthorized — what should I do?
Telegram doesn't accept the token: it was revoked, regenerated in @BotFather, or copied incorrectly. Get a valid token in /mybots → “API Token” and connect Telegram again. You can delete the old channel row: its conversations stay readable in “Conversations”, and its contacts stay in “Contacts”.

Create a bot for free