Empfio Docs

Telegram

Connect a Telegram bot to handle customer inquiries automatically.

Overview

Empfio connects to Telegram via a bot created with BotFather. Customers message the bot; the AI agent replies with text and interactive inline keyboard buttons. The full booking flow — service selection, contact collection, slot picking, and confirmation — works natively in Telegram.

For initial setup steps, see Connect Telegram.

How inbound messages flow

  1. Customer sends a message to your Telegram bot
  2. Telegram forwards the update to Empfio's webhook endpoint
  3. Lead lookup — Empfio finds or creates a lead based on the Telegram user ID
  4. Conversation routing — the message is added to the lead's active conversation
  5. Agent processing — the message is sent to the LangGraph AI agent
  6. Reply delivery — the agent's response is sent back via the Telegram Bot API, with inline keyboard buttons when applicable

Webhook endpoint

POST /api/v1/telegram/webhook

This endpoint is registered automatically when you save the bot token in the dashboard. Empfio calls Telegram's setWebhook API to point to this URL — no manual webhook configuration needed.

Features

Interactive inline keyboards

The agent presents options as tappable inline keyboard buttons:

  • Service selection — customers tap to choose a service instead of typing
  • Time slot picker — available slots are shown as buttons grouped by day
  • Confirmation — "Yes, book it!" / "No, show more times" buttons

Supported message types

Message typeHandling
TextProcessed by the AI agent
Button callbackProcessed as user selection
Voice messageAcknowledged, transcription support depends on configuration
PhotoAcknowledged, not processed by the AI

Bot privacy mode

By default, Telegram bots only receive messages sent directly to them. In group chats, the bot only sees:

  • Messages that start with a /command
  • Replies to the bot's own messages

To let the bot see all group messages, disable privacy mode via BotFather: send /setprivacy → select your bot → choose Disable. For most use cases, keep privacy mode enabled and use direct messages only.

Troubleshooting

ProblemFix
Bot doesn't respondVerify the token in Settings matches what BotFather gave you
"Webhook registration failed"Check that your backend is accessible from the internet
Delayed responsesThe AI model may need a few seconds to generate a reply — this is normal
Buttons not appearingThe agent only shows buttons when presenting discrete options (services, slots, confirmations)
Bot responds in wrong languageThe agent matches the customer's language. Update your business profile to change the default

On this page