Docs refreshed for Astervis v1 — now covering AI call analytics. What’s new
Astervis Docsv1.0
Integrations

Telegram Integration

Connect a Telegram bot as an Open Lines channel.

Telegram is the fastest channel to bring online in Open Lines. You create a bot with Telegram's own BotFather, paste its token into Astervis, and point it at a queue. From that moment, every message a customer sends your bot lands in the same operator console your team already uses for calls — and replies go straight back out through the bot.

Because everything runs on your own server, the bot token and all conversation history stay on your machine. Astervis talks to Telegram's API directly; there's no third-party middleman in between.

Telegram and WhatsApp (Cloud API) are the two channels Open Lines supports today. There is no Instagram channel — if an older guide mentions one, it's out of date.

Before you start

You'll need three things in place:

  • A Telegram account to talk to BotFather (any personal account works).
  • Admin access to Astervis, so you can reach Settings → Open Lines.
  • A queue with at least one available operator, so incoming chats have somewhere to go.

If you haven't set up a queue yet, do that first — see Open Lines. A bot with no queue has nowhere to deliver messages.

Create the bot and connect it

Create a bot with BotFather

Open Telegram and start a chat with @BotFather — the official bot for managing bots. Send /newbot and answer the two prompts:

  • a display name customers will see (for example, ACME Support);
  • a username that must end in bot (for example, acme_support_bot).

BotFather replies with an HTTP API token that looks like 123456789:AAEx.... This token is the bot's password — keep it private.

Anyone holding the token can send and receive messages as your bot. Never paste it into a public chat, screenshot, or commit it to a repository. If it leaks, revoke it with BotFather (/token to reissue, or /revoke) and update the channel in Astervis.

Add the channel in Astervis

In the admin panel, go to Settings → Open Lines → Channels and click Add Channel. Choose Telegram and fill in:

  • a channel name for your own reference (this is internal — customers never see it);
  • the bot token you copied from BotFather.

Save. Astervis registers a webhook with Telegram so new messages are pushed to your server automatically — there's nothing to poll and no extra port to open. The token is encrypted at rest.

Assign the bot to a queue

Open Settings → Open Lines → Queues, edit the queue that should handle these chats, and enable the Telegram channel on it. Conversations from this bot will now be routed to that queue's operators using the same assignment rules as your other channels (lowest current load first, when auto-assign is on).

One bot belongs to one queue. To split sales and support, create a second bot and a second queue — see Running multiple bots.

Test it end to end

Open your bot in Telegram (search its @username or use the t.me/<username> link BotFather gave you) and send a test message. Within a second or two you should see:

  1. the conversation appear in Open Lines in the Waiting state;
  2. an operator notification (or an automatic assignment, if auto-assign is on).

Reply from Astervis and confirm the message arrives back in Telegram. If it doesn't, jump to Troubleshooting.

Configure the bot

Once the channel is live, you can shape how it greets customers and what it understands before an operator picks up.

Welcome message (ru / en / uz)

A welcome message is the first thing a customer sees, so it sets the tone and the expectation. Configure it in Settings → Open Lines → Bots: pick the Telegram channel, enable Welcome Message, and enter text for each language Astervis supports. The bot replies in the customer's own language when it can detect it, falling back to Russian (the default).

Здравствуйте! Это служба поддержки ACME. Опишите, пожалуйста, ваш вопрос — оператор скоро ответит.

You can also set a short auto-transfer delay — the number of seconds after the welcome before the session is handed to a human. Keep it short; Telegram users expect quick replies.

Bot commands

Telegram users type commands that start with /. Register the ones you want to support so they appear in the bot's command menu, and define what each does in the bot settings. A small, predictable set works best:

CommandTypical use
/startSent automatically when a user first opens the bot — triggers the welcome message.
/helpLists what the bot can do and how to reach a person.
/operatorRequests a human operator straight away, skipping any bot flow.

To make commands show up in Telegram's blue Menu button, register them with BotFather using /setcommands. Astervis handles the responses; BotFather controls the menu list.

Supported media

Customers rarely stick to plain text — they send a photo of a receipt, a PDF invoice, or a voice note. Open Lines receives the common Telegram message types and shows them inline in the operator console, where they can be viewed full-size and downloaded. Operators reply with text and can send files back.

TypeCustomer → operatorOperator → customer
Text
Photos
Documents / files
Voice messages
Video
Location

Attachments are stored under the uploads/ directory on your server alongside the rest of your data, so media — like everything else in Open Lines — never leaves the machine.

How a conversation flows

Every Telegram chat becomes a session — the same unit of work as a queued phone call, so a supervisor watches chat and voice side by side. A session moves through three states:

Waiting

The customer has messaged the bot. If a welcome message is configured, the bot replies immediately. The session sits in the queue until an operator is assigned — automatically (to the available operator with the lowest load) or manually by a supervisor.

Active

An operator is handling the conversation. Messages flow both ways in real time, and the operator can use quick replies, transfer the session to another operator or queue, or send files.

Closed

The conversation has ended and moves to history. If the same customer messages again later, a fresh session is created.

Running multiple bots

You can connect as many Telegram bots as you need, each as its own channel wired to its own queue. This is how you separate audiences without confusing operators:

ACME Sales bot → Sales queue
ACME Support bot → Support queue
ACME Orders bot → Orders queue

Each bot has its own token, its own welcome message, and its own set of operators. Sales inquiries and support tickets stay cleanly apart, and each team only sees the chats meant for it.

Security notes

  • Treat the token like a password. It grants full control of the bot. Store it only in Astervis (where it's encrypted at rest) and revoke it via BotFather the moment you suspect it leaked.
  • Webhook authenticity is verified. Astervis registers the webhook with a secret token and checks it on every incoming update, so it only accepts messages that genuinely come from Telegram.
  • Data stays on your server. Conversations, attachments, and the token itself live on your own machine. Open Lines does not send any chat content to a third party. (AI call analysis is a separate, opt-in feature that applies to call recordings, not chats — see AI & privacy.)

Troubleshooting

Next steps

Last updated on

On this page