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
- Customer sends a message to your Telegram bot
- Telegram forwards the update to Empfio's webhook endpoint
- Lead lookup — Empfio finds or creates a lead based on the Telegram user ID
- Conversation routing — the message is added to the lead's active conversation
- Agent processing — the message is sent to the LangGraph AI agent
- 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/webhookThis 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 type | Handling |
|---|---|
| Text | Processed by the AI agent |
| Button callback | Processed as user selection |
| Voice message | Acknowledged, transcription support depends on configuration |
| Photo | Acknowledged, 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
| Problem | Fix |
|---|---|
| Bot doesn't respond | Verify the token in Settings matches what BotFather gave you |
| "Webhook registration failed" | Check that your backend is accessible from the internet |
| Delayed responses | The AI model may need a few seconds to generate a reply — this is normal |
| Buttons not appearing | The agent only shows buttons when presenting discrete options (services, slots, confirmations) |
| Bot responds in wrong language | The agent matches the customer's language. Update your business profile to change the default |