Telegram
With the Telegram channel, your agent answers people who message your own Telegram bot. You create the bot in Telegram with @BotFather, paste its token into Peki, and the published agent starts answering. Conversations show up in the Inbox like any other.
The same bot also carries your automations' messages and approval notices to your team. See Automations and Approvals.
Connect a bot
1. Create the bot in Telegram
- In Telegram, open @BotFather (the official bot with the blue check mark) and send
/newbot. - Choose a display name, for example "Smile Dental Assistant". Customers see it in their chat list.
- Choose a username ending in
bot, for examplesmiledental_bot. It must be unique on Telegram. It becomes your bot's link:t.me/smiledental_bot. - BotFather replies with a token that looks like
123456789:AAH…. Copy it.
The token is the key to your bot. Anyone who has it can read and send your bot's messages. Paste it only into Peki, never into a chat (if you paste it into a Copilot message, Peki takes it out and asks you to use the Telegram card instead).
Optionally, while you're in BotFather, give the bot a picture (/setuserpic), a description (/setdescription) and an about text (/setabouttext). Customers see these before they start a chat.
2. Connect it in Peki
- Open the agent and go to Channels → Telegram.
- Paste the token into Bot token and press Connect. The button shows Checking… while Peki verifies the token with Telegram.
- When it's accepted, the card shows your bot as
@your_bot, and Answer messages to this bot is turned on.
You can also connect from the Copilot: ask it to connect Telegram, and it shows a Connect Telegram card with the same steps. The Copilot never sees the token.
The token is stored encrypted and is never shown again, not even to you. Within about 10 seconds the bot starts answering.
3. Publish and try it
Customers always talk to the published version. If the agent isn't published yet, the card says so, and the bot replies "This assistant is not available yet." to everyone. See Publishing and versions.
Open t.me/your_bot (the link is on the card), press Start, and write a message.
/start, which Telegram sends when someone opens your bot for the first time, is passed to the agent like any other message. A short instruction such as "When a customer sends /start, greet them and say what you can help with." gives new customers a good first reply. See Instructions.
Settings
| Setting | What it does | Default |
|---|---|---|
| Bot token | The token from @BotFather. Checked with Telegram before it's saved. Pasting a new token replaces the old bot. | None |
| Answer messages to this bot | Off, the bot stops answering; the token is kept. On, the published agent answers again. | On after connecting |
The status next to the card's title reads not connected, On or Off.
What's supported
| Feature | How it works |
|---|---|
| Private chats | The bot answers one-to-one chats only. Messages in groups and channels are ignored. Messages from other bots are ignored. |
| Text | Up to Telegram's own limits. The agent's replies keep their formatting (bold, italics, code, links); lists and tables are turned into lines Telegram can show. Replies longer than one Telegram message are split between paragraphs. |
| Photos and documents | Photos (the largest size Telegram has), PDFs and text files (TXT, MD, CSV), up to 10 MB. The caption is the message. See Files and attachments. |
| Unsupported media | Voice messages, audio, video, video notes, stickers and GIF animations get the reply "I can't open this kind of file yet. Please send a photo, a PDF or a text file, or write your message." Nothing is stored. |
| Typing indicator | The bot shows "typing…" while the agent works. |
/new | Starts a new conversation. The bot replies "New conversation started. How can I help?" |
/feedback | Asks "Was this conversation helpful?" with 👍 and 👎 buttons, when the agent has answered. Otherwise: "There is nothing to rate yet." Send it again to change a rating; the last one counts. |
| Feedback on resolve | When your team resolves a conversation the agent answered last, the bot asks for 👍/👎. Ratings show in Analytics. |
| Team replies | When a teammate takes over, their messages and files go out from the bot. |
| Customer profile | The person's Telegram name, @username and app language are filled in on their customer profile. |
The bot's command menu lists /new and /feedback, in English, or in Turkish for people whose Telegram is in Turkish. Peki sets it every time the bot starts.
The bot's own short messages (busy, not available, file refused and so on) are in Turkish for people whose Telegram app is in Turkish and in English for everyone else. The agent's replies follow the language the customer writes in.
Sessions on Telegram
Telegram has no "new chat" button, so a chat is split into conversations by time: a message continues the current conversation unless it was resolved, the person sent /new, or it has been quiet longer than the agent's Start a new session after setting (24 hours by default). See Customers.
Messages for your team
Your team can get messages from the same bot:
- Automation messages. An automation can message people on Telegram. A teammate joins the agent's chats by opening the link
t.me/your_bot?start=alertsand pressing Start; the bot replies "You'll get this agent's alerts here." See Automations. - Approval notices. Actions waiting for approval can be announced in Telegram chats you choose under Inbox → Approvals → Notify on Telegram. See Approvals.
One bot, one agent
A bot answers for one agent at a time.
- Connected to another agent in this workspace: Peki asks "This bot is connected to agent. Move it here?" Press Move it here to move it. The other agent stops answering on Telegram; its conversations stay in its Inbox.
- Connected in another workspace: the token is refused with "This bot is in use elsewhere. If it's yours, renew its token with BotFather (/revoke) and connect the new token."
To run two agents on Telegram, create a bot for each.
Peki receives your bot's messages by asking Telegram for them (polling), so you don't need a server or a public address. Connecting a bot removes any webhook it had, so the bot can't feed another system at the same time.
Disconnecting
- Go to Channels → Telegram.
- Press Disconnect bot and confirm: "The agent stops answering this bot. The token is deleted."
The bot stops answering within about 10 seconds. Its conversations stay in the Inbox. The bot itself still exists in Telegram: delete it in @BotFather with /deletebot if you no longer need it.
To pause the bot without losing the token, turn off Answer messages to this bot instead.
Deleting the agent also disconnects its bot.
Troubleshooting
| Problem | Why, and what to do |
|---|---|
| "That does not look like a bot token. Copy it again from @BotFather." | The text isn't in the token's format (digits, a colon, then a long code). Copy the whole token again, without spaces. |
| "Telegram didn't accept this token (Unauthorized). Copy it again from @BotFather." | The token is wrong or was revoked. Get the current one from @BotFather with /token, or a new one with /revoke. |
| The bot doesn't answer | Check the card says On, the agent is published, and you're writing in a private chat with the bot, not in a group. Changes take up to about 10 seconds. |
| The bot replies "This assistant is not available yet." | The agent isn't published. Publish it. |
| The card warns "This bot is also being used somewhere else (another server or app)." | Another program is reading the same bot's messages, so some messages may go there instead of to Peki. If that isn't you, run /revoke in @BotFather and connect the new token. |
| The bot stopped answering after I changed something in BotFather | If you revoked the token, the old one no longer works. Connect the new token. |
| "This bot is in use elsewhere…" | The bot is connected in another Peki workspace. If it's your bot, revoke its token in @BotFather and connect the new one here. |
| Customers get "We are very busy right now. Please write again in a little while." | A chat sent more than 20 messages in a minute, or your workspace reached its daily reply limit. |
| A file was refused | See the file rules in Files and attachments. Files must be photos, PDFs or text files up to 10 MB. |
| "I couldn't download that file. Please send it again." | Telegram didn't hand the file over after several tries. Ask the customer to send it again. |