Astervis Docs

Telegram Integration

Set up a Telegram bot for customer support

Connect a Telegram bot to receive and respond to customer messages through Open Lines.

Prerequisites

  • Telegram account
  • Admin access to Astervis
  • A queue set up for Telegram conversations

Setting Up

Create a Telegram Bot

  1. Open Telegram and search for @BotFather
  2. Send /newbot
  3. Follow prompts:
    • Enter bot name (e.g., "ACME Support")
    • Enter username (must end in bot, e.g., acme_support_bot)
  4. Copy the bot token provided

Keep your bot token secret. Anyone with the token can control your bot.

Add Channel in Astervis

  1. Go to SettingsOpen LinesChannels
  2. Click Add Channel
  3. Select Telegram
  4. Enter:
    • Channel name (for internal reference)
    • Bot token (from BotFather)
  5. Click Save

Assign to Queue

  1. Go to SettingsOpen LinesQueues
  2. Edit the queue that will handle Telegram messages
  3. Enable the Telegram channel
  4. Save

Test the Connection

  1. Open your bot in Telegram
  2. Send a test message
  3. Check Astervis Open Lines — you should see the conversation
  4. Reply from Astervis
  5. Verify reply appears in Telegram

Configuring the Bot

Welcome Message

Set up an automatic greeting:

  1. Go to SettingsOpen LinesBots
  2. Select your Telegram channel
  3. Enable Welcome Message
  4. Enter greeting text for each language:
    • English: "Hello! How can we help you today?"
    • Russian: "Здравствуйте! Чем можем помочь?"
    • Uzbek: "Assalomu alaykum! Qanday yordam bera olamiz?"
  5. Set Auto-transfer delay (seconds before human takes over)
  6. Save

Bot Commands

Configure what happens when users send commands:

CommandTypical Use
/startInitial greeting, menu
/helpList available options
/statusCheck order/ticket status
/contactRequest human operator

Set up command responses in bot settings.

Message Types

Supported

TypeReceiveSend
Text
Photos
Documents
Voice messages
Video
Stickers
Location

Handling Media

When customers send photos or documents:

  1. Media appears in chat with preview
  2. Click to view full size
  3. Download if needed
  4. Reply with text or your own files

Conversation Flow

New Customer Messages

  1. Customer sends message to your bot
  2. Session created in Waiting status
  3. Auto-assigned to available operator (if enabled)
  4. Operator sees notification
  5. Operator responds through Astervis
  6. Reply sent via Telegram bot

Session States

StateWhat Happens
WaitingBot replied (if configured), awaiting operator
ActiveOperator assigned and responding
ClosedConversation ended

Multiple Bots

You can connect multiple Telegram bots for different purposes:

  • Sales Bot — Pre-sales inquiries
  • Support Bot — Technical support
  • Orders Bot — Order status updates

Each bot connects to its own queue with dedicated operators.

Security

Token Security

  • Never share bot token publicly
  • Regenerate token if compromised (via @BotFather → /revoke)
  • Astervis encrypts tokens at rest

Webhook Verification

Astervis uses secret tokens to verify incoming webhooks are from Telegram.

Troubleshooting

Messages Not Appearing

  1. Verify bot token is correct
  2. Check channel is active
  3. Ensure queue has available operators
  4. Check webhook status in channel settings

Bot Not Responding

  1. Verify Astervis service is running
  2. Check welcome message settings
  3. Ensure operators are available (or auto-assign enabled)

Delayed Messages

  1. Check operator workload
  2. Verify auto-assign is enabled
  3. Review queue settings

Best Practices

  1. Quick responses — Telegram users expect fast replies
  2. Clear welcome message — Set expectations immediately
  3. Use quick replies — Speed up common responses
  4. Monitor queue — Don't let sessions wait too long
  5. Test regularly — Send test messages to verify flow
  6. Descriptive bot name — Customers should recognize your brand