To add Telegram, create a bot in @BotFather, paste its token into a new Telegram inbox in your panel and route that inbox to the AI assistant. People then write to the bot in private messages, and the assistant and your agents reply to them from the panel.
Create the bot in BotFather
- In Telegram, open @BotFather and send
/newbot. - Enter a name for the bot, then its username. The username must end in
bot, for exampleacme_support_bot. - BotFather sends you the bot token, a line like
123456789:AAH.... The token works as the bot's password: keep it to yourself and do not forward it to anyone.
In the same chat, /setuserpic sets the bot's picture and /setdescription its description.
One bot works in one place
A Telegram bot hands each message to one receiver only. If the same bot is still connected to another system, such as an older helpdesk or a script, messages get split between the two or stop reaching your panel. Switch the bot off in the other system before you connect it here. You do not have to remove the other system's webhook yourself: when you save the inbox, the panel points the bot at your site.
Inside the panel, one bot belongs to one inbox. Saving the token of a bot that another inbox already uses fails with "This bot is already connected to another inbox. Open that inbox to manage it." A saved inbox also refuses the token of a different bot: for a second bot, create a second inbox.
Switching the inbox off with Enabled, or deleting the inbox, releases the bot for another system: the panel removes its webhook and stops asking Telegram for its messages. Inside the panel the bot stays tied to a switched-off inbox; to connect it to another inbox, delete the old one first.
Add the Telegram inbox
Open Admin > Inboxes > New inbox and choose Telegram (Connect a Telegram bot). Admin is the shield icon, the last one in the upper group of the left bar. Inboxes is the item under Channel in the admin menu, not the Inboxes icon at the top of the left bar, which holds your conversations. The page address ends in /admin/inboxes.
Fill in these fields:
| field | what to enter |
|---|---|
| Name | how the inbox is called in the panel, for example Telegram |
| Bot token | the token from BotFather |
| First message | the greeting, see the next sections |
Leave the other fields as they are for now and press Create. The panel checks the token with Telegram right away, and a wrong token is not saved: you get "The bot token is invalid. The bot cannot connect. Copy the token from BotFather and try again." or a message that Telegram could not verify the token.
Route the inbox to the assistant
The assistant answers only conversations that are assigned to it, and an automation rule does the assigning. Inboxes that existed when your platform was launched already have such a rule. A Telegram inbox you add later needs its own: follow Routing a new channel to the assistant.
Without the rule, new Telegram conversations wait in the list for an agent, and no first message goes out: the AI notice is sent only where the assistant answers. Add the rule right after you create the inbox.
The first message and the AI notice
When someone starts a conversation with the bot, they get the text from First message. To greet people in their own language, write one line per language, each starting with a language code, and a default line for everyone else:
de: Hallo! Wie können wir helfen?
es: ¡Hola! ¿En qué podemos ayudarte?
default: Hello! How can we help?
The panel picks the line for the language of the person's Telegram app, or for your site's language when the panel does not support theirs, and the default line when there is no such line. With several lines and no default line, such people get only the AI notice; a single line goes to everyone. Every line needs a code: if one line has none, the whole text goes out as a single greeting.
The panel always adds a notice that the person is talking to an AI: "You are chatting with an AI assistant. Ask for a human at any time and I will pass you on." With AI chat without agents on, only the first sentence is sent. The notice cannot be switched off, because the EU AI Act requires it. It comes in the language of the person's Telegram app when the panel has a translation for it, otherwise in your site's language or in English. The first message is sent only when your site has an AI assistant switched on.
Leave Greeting message in the Automatic replies block empty. That field is the channel's plain automatic reply without the AI notice, and it stays silent while the assistant runs a conversation. With the bot, the greeting comes from First message, together with the AI notice.
AI chat without agents
Turn on AI chat without agents when nobody but the bot answers in this channel, for example when the bot answers employees from internal documentation. The assistant then never hands a conversation to agents. When the knowledge base has no answer, it says so and asks for another question, and when someone asks for a human, it explains that only the AI answers here.
In this mode the bot menu has no Call an operator item, the AI notice does not promise a human, and the Away message is not sent. Agents still see these conversations in the list and can answer any of them by assigning it to themselves. More in AI chat without agents.
Invite link only
Anyone can find a Telegram bot through Telegram search. If your bot answers from internal knowledge, turn on Invite link only: the bot then answers only people who opened it through your invite link, which looks like https://t.me/<bot>?start=<code>.
- After you save, the link appears under Invite link, with a copy button and New link next to it. When you create a new inbox with this switch on, the panel opens that inbox right away, so the link is in front of you.
- Anyone else who writes to the bot gets "This bot works by invitation only. Ask your team for the link." in the language of their Telegram app, at most once a minute. Nothing from them appears in the panel.
- New link turns the current link off. The panel asks Issue a new link? and then saves the form. Everyone who joined through the old link opens the new one once. Use it when someone leaves the team or the link leaks.
- The code from the link never shows up in the conversation.
- To remove one person, open Contacts in the left bar, open that person, choose Block in the menu next to their name and confirm. The bot stops answering them. Unblock in the same menu lets them back.
Where to share the invite link
Share the link only where your own people see it, for example in your team chat or in the sidebar of your Confluence space. In Confluence Data Center and Server this is "Space tools", "Configure sidebar", "Add link"; in Confluence Cloud, add the link as a shortcut in the space sidebar. Either way it needs space administrator rights, not rights over the whole wiki. This is also the way to bring the bot into Confluence when the wiki administrator does not allow the chat code there, and on Confluence Cloud, which has no place for that code: see Chat inside Confluence.
Check that the bot works
Write to the bot from your own Telegram account. With Invite link only on, open the bot through the invite link first. You should get the first message, and then the assistant should answer your question. If nothing comes back, see "When the bot does not answer" below.
The bot menu and commands
The bot gets a menu with two commands, in each person's Telegram language when the panel has it:
- Start the conversation (
/start) opens a conversation. In the panel it shows up as the customer's message "The customer started the conversation.", in the person's Telegram language when the panel has it. - Call an operator (
/operator) asks for a human, and so do/helpand/support. In the panel such a command shows up as the customer's message "Please call an operator.", and the assistant takes it as a request for an agent and hands the conversation over while its Offer handoff to a human setting is on (see Handoff to agents and back).
With AI chat without agents on, the menu has only Start the conversation, and the assistant answers a request for a human by saying that only the AI answers here.
While the assistant answers
- The person sees that the bot is typing while the assistant prepares an answer.
- Telegram does not accept messages longer than 4096 characters and does not show tables, so a long answer arrives as several messages and a table comes as lines of text.
- When the assistant offers short answer options, they appear as buttons under its message, and a tap sends the option as the customer's reply.
- When the assistant asks whether the answer helped, the question comes in the same message as the answer, with buttons Yes, thanks and I need more help in the language of the answer when the panel has that language.
When a conversation continues
While a conversation is open, everything the person writes goes into it. Once a conversation is resolved, Reopen window (hours) decides what happens to the next message: within that many hours it reopens the same conversation, later it starts a new one. A new inbox starts with 48 hours. With 0, a resolved conversation is never reopened and the next message always starts a new one.
Away message
Away message goes out when a customer writes outside your business hours, at most once a day. Once the field has text, choose Business hours (a saved schedule) and the Timezone next to it: the form does not save an away message without a schedule. While the assistant runs the conversation, the away message is not sent, because the bot answers around the clock. Schedules are set up as described in Macros, tags, SLA and business hours.
Customer ratings (CSAT)
With CSAT Surveys on, the customer is asked to rate the conversation right in Telegram when it is resolved: five star buttons from 1 to 5, and a link Additional feedback (optional) for a comment. Survey message is the text above the buttons. Left empty, a built-in text goes out in the customer's language. Each conversation gets one survey at most.
Files over 20 MB
Telegram lets bots download files of up to 20 MB only, so a long video or another large file may not get through. The customer then gets a short notice. Write your own text in Message for oversized files, or leave the field empty for the built-in text, which goes out in the customer's Telegram language. The agent sees a note in the conversation that the file could not be received.
Receiving messages: webhook or polling
Receive messages sets how messages reach your panel:
- Automatically, the default, uses a webhook when your site has a public HTTPS address and polling otherwise. Your site address is a public HTTPS address, so this means the webhook. Keep this setting.
- Webhook: Telegram delivers each message to the Callback URL of the inbox,
https://<your site address>/webhooks/telegram/<inbox number>. The address is shown after you save, with a copy button, but you do not need to paste it anywhere: the panel registers it with Telegram when you save, and again if your site address changes. Every delivery carries a secret that only the panel and Telegram know, so nobody else can post messages into the inbox. - Polling: the panel asks Telegram for new messages itself. Poll timeout (seconds) applies only to polling; leave it as it is.
Private chats only
The bot works in private chats only. It ignores groups and channels, even if someone adds it there. A conversation always starts with the customer: an agent cannot write first to a person who has never messaged the bot.
Replying from the panel
Agents answer Telegram conversations in the usual reply box, with a few extras:
- Add button attaches up to 10 buttons to a reply. Each button has Button text and Link (optional). A button with a link (http, https or tg) opens it; a button without a link sends its text back as the customer's reply.
- Record audio records a voice reply.
- Files can be up to 50 MB each. Several photos, videos or documents sent together go out as albums of up to 10 files.
- A reply longer than Telegram allows is not sent, and the panel asks to shorten it.
Edited messages and other content
- When a customer edits a message, the panel shows the corrected text in place. If the assistant runs the conversation, it also gets the corrected text as a new message marked "[the customer corrected their message]", so it answers the new version.
- Content that the panel cannot display, and stickers that cannot be played there, come with a note for the agent.
- Once speech recognition is set up, voice messages are turned into text for the assistant and the agent: see Voice messages.
Telegram contacts and identity checks
Each person who writes becomes a contact with their Telegram name, username, profile photo and app language. A Telegram account does not prove who the person is in your own systems, so the assistant never treats a Telegram contact as signed in. Custom tools marked Require verified contact run only after the person confirms an email address with a one-time code that the assistant sends by email. The code goes out through your own mail, not the EPAV mailbox: see Custom tools and Notifications and the EPAV mailbox.
Chats with a Telegram Business account
If you run a Telegram Business account, you can connect this bot to it in Telegram; the bot's owner first allows this for the bot in @BotFather. Messages that customers send to your business account then arrive in this inbox as well, replies you type in Telegram itself appear in the conversation, and the invite link does not apply to these chats.
If the token leaks
- In @BotFather send
/mybots, choose your bot, then "API Token" and "Revoke current token". BotFather gives you a new token. - In the panel, open the Telegram inbox, paste the new token into Bot token and press Save.
The saved token is shown masked in the form: delete the dots before you paste the new token. As long as you leave the masked value unchanged, the inbox keeps its current token, and an empty field is not accepted. A new token must belong to the same bot.
Other settings in the form
- Enabled switches the inbox on and off. Switched off, the bot stops receiving messages.
- Prompt to tag before replying warns agents before they reply in a conversation that has no tags.
When the bot does not answer
- Make sure the inbox is routed to the assistant (see above) and that Enabled is on.
- Look at the top of the inbox form. "Another system is polling this bot with the same token, so messages are split between the two. Stop the other system or connect a new bot." means the bot is still connected somewhere else. A notice that starts with "The inbox was saved, but Telegram webhook setup failed" means Telegram did not take the delivery address: save the inbox again.
- With Invite link only on, open the bot through the current link: an old link stops working after New link.
- If it still does not work, write to support@epavdesk.com.