Connect Telegram to B6AI
Connect the Telegram channel end to end, set up Telegram, connect it in B6AI, publish your bot, and go live with confidence.
Overview
Connecting a Telegram bot lets customers chat with your B6AI bot on Telegram. It’s the quickest messaging channel to set up, a single token from BotFather, with no business verification required.
Telegram is great for communities, quick support and self-serve bots.
What you can do on Telegram
Connecting Telegram lets your bot hold real conversations there, with full handoff to human agents when needed. On this channel you can:
- Answer Telegram messages with your bot.
- Use inline buttons and custom keyboards.
- Hand off to a human agent in the Chats inbox.
- Send media and support both 1:1 and group chats.
- Deep-link customers straight to your bot.
How the Telegram channel works
You create a Telegram bot with BotFather and receive a token. B6AI registers a webhook with Telegram using that token; inbound messages arrive at B6AI, which replies via the Telegram Bot API. There’s no OAuth, the token alone controls the bot, so keep it secret.
Prerequisites
Have all of the following ready before you begin, each is required to complete the connection.
- A Telegram account.
- A bot token from BotFather (created in the next step).
- The Enterprise Admin role in B6AI.
Create a Telegram bot with BotFather
- In Telegram, search for @BotFather (the official one, with a verified badge) and open a chat.
- Send /newbot and choose a display name.
- Choose a unique username ending in “bot” (for example yourco_support_bot).
- BotFather replies with your HTTP API token, copy it.
- Optionally set a description, about text and profile photo with /setdescription, /setabouttext and /setuserpic.
Get your Telegram Bot token
These are the values you will paste into B6AI. Copy each one carefully.
- Copy the token BotFather gave you (format 123456789:ABC-DEF…).
- Keep it secret: anyone with the token controls your bot. If it leaks, use /revoke in BotFather to reissue it.
Bot token: 123456789:AAExampleTokenStringFromBotFatherConnect Telegram in B6AI
Channels are configured per bot. In B6AI, open Bots and choose the bot you want on Telegram, switch to its Channels tab, and click Configure on the Telegram card. Complete the form (every field is explained below), Save, then toggle Enable to turn the channel on.
- In B6AI, open Bots, choose your bot, and go to its Channels tab.
- Click Configure on the Telegram card.
- Paste the bot token and the bot username.
- Save, then toggle Enable. B6AI registers the webhook with Telegram and validates the token automatically.
{
"provider": "telegram",
"bot_token": "123456789:AAE…"
}| Field | What it is | Example value |
|---|---|---|
| Bot token | The BotFather HTTP API token | 123456789:AAE… |
| Bot username | Your bot’s @username (without the @) | yourco_support_bot |
Publish the bot to Telegram
Once the channel is configured and enabled on the bot, publish the bot so customers get answers on Telegram.
- On the bot’s Channels tab, confirm the Telegram channel shows Configured and is Enabled.
- Open the bot in Bot Builder and run it through the test simulator until it passes validation.
- Click Publish. The bot now serves conversations on Telegram.
Verify with a test conversation
Confirm the channel is live end to end before sharing it with customers.
- Open t.me/<your_bot_username> (or search the username in Telegram) and press Start.
- Send a message and confirm the bot replies.
- Check the conversation appears in the Chats inbox and test a handoff.
Messaging rules & behavior
Every channel has its own rules about when and how businesses may message customers. Understanding these prevents blocked or undelivered messages.
- A user must Start the bot (press Start or send /start) before it can message them.
- There’s no fixed 24-hour window like Meta channels, but avoid unsolicited messaging.
- In group chats the bot must be added; with privacy mode on it only sees messages that mention it.
- Broadcasts are rate-limited by Telegram.
Troubleshooting
If messages are not delivered or the bot does not reply, match the symptom below to its cause and fix.
| Symptom / error | Likely cause | How to fix it |
|---|---|---|
| The bot doesn’t respond | Webhook not set or wrong token | Reconnect in B6AI to re-register the webhook and re-validate the token |
| 401 Unauthorized | Invalid token | Re-copy the token from BotFather; use /revoke to reissue if it leaked |
| Can’t message a user first | The user never pressed Start | Users must start the bot before it can reach them |
| Group messages are ignored | Privacy mode is on | Disable privacy mode via BotFather (/setprivacy), or mention the bot |
Limitations
Keep these constraints in mind when designing conversations for Telegram.
- Users must initiate the conversation by starting the bot.
- The Bot API has throughput limits (roughly 30 messages/second overall).
- Privacy mode restricts what the bot sees in groups; the token grants full control of the bot.
Security & compliance
- Grant only the scopes and permissions listed above, never request more “just in case”.
- Rotate your Telegram Bot token on a regular schedule, and immediately if you suspect exposure.
- Restrict the Enterprise Admin role (which manages integrations) to a small, trusted group.
- Prefer a dedicated service account or bot user over a personal login, so access survives staff changes.
- Review the integration’s activity in the B6AI Activity Logs periodically for unexpected calls.
- Disconnect the integration the moment a credential leaks; then rotate it in Telegram before reconnecting.
Recommendations
- Test against a sandbox or non-production Telegram account before connecting live data.
- Document which bots and flows depend on this integration so changes are predictable.
- Set a recurring reminder to review scopes and rotate credentials.
- Enable only the capabilities you actually use today; you can widen scopes later.