Connecting Telegram Business
Telegram Business connects your personal Telegram account to AISAR the official way: through your own bot with Business Mode, with no QR login into the account. Clients write to you as before, and operators reply from the shared inbox in your name. Here's how to create the bot, connect it in Telegram, and what limits the channel has.
What you'll need
- The Telegram account whose conversations you want in AISAR, and a phone or computer where it is signed in. Telegram Premium is not required.
- Your own bot in @BotFather with Business Mode switched on. You can create it during the setup (step 1 below). Clients never see the bot: it only serves as a pass to your account.
- A new or unused bot. A bot already connected to AISAR (including as a Telegram Bot channel) will not connect a second time. For a bot that works in another service, AISAR takes over message delivery: a bot can have only one webhook.
- One bot per account. If several managers reply to clients from their own accounts, each of them needs their own bot and their own channel.
- Access to my.aisar.app with the right to connect channels (the administrator or manager role) and a free slot in your plan's channel limit: Telegram Business counts like any other channel. Plans are described on aisar.app.
What works
- New messages from the chats you give the bot access to arrive in the shared AISAR inbox: text, photos, videos, audio, voice messages, documents, stickers, locations.
- Replies from operators and the AI agent go out from your account. The client sees an ordinary conversation with you, not with a bot.
- Replies you type on your phone also reach AISAR, marked «Sent from Telegram». Greeting and away messages set up in Telegram Business arrive marked «Telegram auto-reply».
- The contact is the same as in a personal Telegram channel: if the client wrote to you there before, their card, deals and history stay with them.
- Automations with a Telegram channel condition fire on this channel too.
Telegram limits
- You can reply only within 24 hours of the client's last message. If the client has been silent longer, Telegram will not deliver the reply until the client writes again. The AISAR chat shows a hint in this case.
- You cannot write to a client first. A new conversation cannot be started through this channel, and it takes no part in broadcasts.
- Telegram gives the bot no conversation from before the connection: only new messages appear in AISAR.
- Private chats only, no Telegram groups or channels.
- Message buttons are not supported yet, so the quality survey goes out as text. Reactions from AISAR are not available on this channel.
Step 1. Create the bot and turn on Business Mode
- Open @BotFather in Telegram and send
/newbot. Choose a name and an address for the bot, for example «Dental Almaty reception» and@dentalmaty_desk_bot. The address must end inbot. - Turn on Business Mode:
/mybots→ your bot → Bot Settings → Business Mode → Turn on. - Copy the token from BotFather's message. It looks like
7412869035:AAG…. For a bot you already have, the/tokencommand shows it.
Step 2. Check the bot in AISAR
- In my.aisar.app open Settings → Channels → Add channel and click Connect on the Telegram Business card. The "Connect Telegram Business" wizard opens, with four steps: Overview, Bot, Connect in Telegram, Done.
- On the Overview step, read how this channel differs from personal Telegram and a Telegram bot, then move on to the Bot step.
- Paste the token into the Bot token field. The Channel name can stay empty: the channel is then named after the account you connect.
- Click Check and connect. AISAR checks the token, makes sure Business Mode is on, and sets up message delivery. The token is stored encrypted. From this point the channel exists and waits for the bot to be connected in Telegram.
Step 3. Connect the bot in the Telegram app
- On the phone or computer where the right account is signed in, open Settings → Telegram Business → Chatbots.
- Enter your bot's address and select it.
- In the chat access section choose «Selected chats only» and tick the clients or chat types. You can keep «All chats», but then add your personal contacts to the exceptions.
- Grant the bot the rights described in the next section, and save.
- Go back to the AISAR wizard. As soon as Telegram reports the connection, the Connect in Telegram step shows the account and the granted rights; there is no need to reload the page. You can close the wizard with Finish later: the channel connects when you add the bot. Cancel connection deletes the channel and frees the bot and the plan slot.
Which rights to give the bot
| Right in Telegram | Needed? | Why |
|---|---|---|
| Reply to messages | Required | Without it operators and the AI agent cannot reply from AISAR: messages will arrive, but sending will be blocked. |
| Read messages | Recommended | Read receipts. AISAR does not send them yet; the right will be needed in the next version, so it is better to turn it on now. |
| Delete messages sent by the bot | Optional | Needed to delete replies already sent from AISAR. |
| Everything else | Leave off | Profile (name, bio, photo, username), gifts and stars, stories, deleting any message. AISAR does not use these rights, and with them the bot token gives too much control over the account. |
Rights are changed only in Telegram, and AISAR picks them up after every change. If you gave the bot excess rights, the channel page shows a warning with the list: remove them in Telegram, the connection keeps working and the warning goes away by itself. Without the «Reply to messages» right the channel connects in read-only mode, and sending from the chat is unavailable until you turn it on.
If the account is already connected as a personal Telegram
If the same account is already connected in the company as a «Telegram» channel (personal, via QR code), AISAR stops the connection through the bot: otherwise every message would reach AISAR twice, and the AI agent would reply twice. The wizard and the channel page say that the account is already connected as a personal Telegram. Moving from a personal channel to Telegram Business looks the same:
- Disconnect the personal Telegram channel in AISAR. Its history and chats stay.
- In Telegram open Settings → Telegram Business → Chatbots, remove the bot and add it again. Instead, you can click Reconnect on the Telegram Business channel page.
- The connection goes through, and new messages come in through Telegram Business. The contact stays the same as in the personal channel, and the earlier conversation stays in the personal channel: it cannot be moved into Telegram Business.
Sometimes AISAR cannot check whether it is the same account and shows the warning «This account may already run a personal Telegram channel». The connection goes through in that case. If it really is the same account, disconnect the personal channel, otherwise messages will arrive twice. Only one of the two channels works at a time: if the personal channel on this account is connected again later, AISAR stops the Telegram Business channel.
How to check the channel is working
In the channel list (Settings → Channels) the channel shows the Connected status, and on its page the "Telegram Business connection" block shows the account, the bot and the granted rights. Ask a colleague to message you in Telegram: the message should appear in the Chat section within a few seconds, and a reply from AISAR should arrive in your name.
If the channel disconnects
- The bot is switched off in Telegram. New messages do not arrive and replies are not sent; the history in AISAR is kept. Turn the bot back on in Settings → Telegram Business → Chatbots, and the channel comes back by itself.
- The bot token no longer works. This usually happens after the token is reissued in @BotFather. On the channel page click Reconnect and paste a new token of the same bot. A token of another bot will not work: connect another bot as a new channel.
- The channel is switched off in AISAR. Click Reconnect on the channel page and leave the token field empty: AISAR reconnects the channel with the stored token.
Common issues
| Symptom | Cause and what to do |
|---|---|
| «The token did not work» | Copy the token again: send /mybots to @BotFather, pick the bot and tap API Token. Paste the token in full, with no spaces or line breaks. |
| «Business Mode is off for this bot» | Turn the mode on in @BotFather (/mybots → the bot → Bot Settings → Business Mode → Turn on) and click Check and connect again. No need to re-enter the token. |
| «This bot is already connected to AISAR» | One bot serves one channel. If this is your old channel, delete it in the channel list. Otherwise create a new bot in @BotFather with /newbot. |
| «Telegram did not accept the message delivery address» or «Telegram is not responding right now» | No channel is created in this case. Click Check and connect again in a minute. If it happens again, contact support and mention the bot's address. |
| The wizard keeps waiting for the connection | Check that the bot was added in Telegram on the account you want in AISAR and that the chatbot settings were saved. The channel waits with no time limit; you can close the wizard and come back later from the channel page. |
| The chat says «Sending is unavailable» | The reason is shown below the message. Most often the bot does not have the «Reply to messages» right: turn it on in Telegram and the status updates by itself. Other reasons: the bot is switched off in Telegram, the token no longer works, or the account is already connected as a personal Telegram (see the sections above). |
| A reply to a client was not delivered | The client wrote more than 24 hours ago, and Telegram does not allow a reply. Wait until the client writes again. This is Telegram's limit, not AISAR's. |
| The plan channel limit is reached | Disconnect an unused channel, or raise the limit with an extra-channel add-on in Billing. Plans are described on aisar.app. |
See also
Need a channel not tied to a personal account, where clients write to a bot? See Connecting Telegram Bot. For personal Telegram via QR code, see Connecting Telegram; for channel statuses, see A channel is stuck reconnecting: what to do.