Telegram Integration
Deploy your AI agent to Telegram groups for automated conversations
Telegram Integration#
Deploy your AI agent to Telegram groups to handle conversations automatically. AlonChat uses a shared bot, so there is no need to create your own bot with BotFather.
Setting Up#
Step 1: Add a Telegram Group#
- Go to your agent dashboard
- Navigate to Deploy > Telegram
- Click Add Telegram Group
- Give the group a label (e.g., "Customer Support Group")
Step 2: Get the Link Code#
After creating the group:
- A link code is generated
- Copy the link code
- Follow the on-screen instructions to add the AlonChat bot to your Telegram group
Step 3: Add the Bot to Your Group#
- Open your Telegram group
- Add @AlonChatBot as a member
- The bot will automatically detect the group and verify the link code
- Auto-polling checks every 5 seconds for verification
Step 4: Verify Connection#
Once the bot is added and detected:
- The group status changes to "Verified"
- The channel is auto-enabled
- Your agent starts responding to messages in the group
How It Works#
Shared Bot Model#
AlonChat uses a shared bot (@AlonChatBot) for all Telegram integrations. This means:
- No BotFather setup required -- You do not need to create or manage your own Telegram bot
- Automatic message routing -- The shared bot routes messages to the correct agent based on which group they come from
- Dedicated bot option -- If you have configured a dedicated bot token in your agent settings, it takes priority over the shared bot
The shared bot approach simplifies setup significantly. You just add @AlonChatBot to your group and link it with a code -- no API tokens or webhook configuration needed on your end.
Message Flow#
User sends message in Telegram group
|
@AlonChatBot receives the message
|
Message is routed to the correct AlonChat agent
|
Agent processes message (RAG retrieval)
|
Agent generates response using AI model
|
Response is posted in the Telegram group
Features#
| Feature | Status |
|---|---|
| Text messages | Supported |
| Auto-reply | Supported |
| Human handoff | Supported |
| Conversation history | Tracked |
| Lead capture | Supported |
| Multiple groups | Supported |
Bot Commands#
Telegram users can use these commands in the group:
| Command | Description |
|---|---|
/start | Start a conversation with the agent |
/help | Display help information and available commands |
/human | Request to speak with a human agent |
These commands work alongside natural language -- users can also just type their questions directly.
Managing Groups#
Multiple Groups#
You can connect multiple Telegram groups to a single agent:
- Click Add Telegram Group for each new group
- Each group gets its own link code and settings
- Manage all groups from the Deploy page
Group Actions#
- Copy link code: Share with group admins
- Regenerate link code: If the code expires or is compromised
- Delete group: Remove with confirmation dialog
- Test message: Send a test message to verify the bot is working
Best Practices#
1. Set a Clear Group Description#
Let group members know there is an AI assistant:
"This group is powered by [Company Name]'s AI assistant. Ask questions anytime and get instant answers."
2. Test Before Going Public#
Before sharing the group link:
- Send several test messages covering common questions
- Verify the agent responds accurately
- Test the
/humancommand to make sure handoff works - Check that conversations appear in your AlonChat dashboard
3. Monitor Conversations#
Check your AlonChat dashboard regularly:
- Review AI responses for accuracy
- Look for unanswered or poorly answered questions
- Add missing information to your sources
4. Use Multiple Groups for Different Topics#
Organize by purpose:
- "Sales Questions" -- product inquiries and pricing
- "Customer Support" -- troubleshooting and account help
- "General Info" -- business hours, locations, FAQs
5. Regenerate Link Codes Periodically#
For security, regenerate link codes if:
- A group admin leaves your organization
- The code was shared publicly by mistake
- You suspect unauthorized access
Troubleshooting#
Bot Not Responding in Group#
Check these in order:
-
Bot is a group member:
- Open the group in Telegram
- Check the member list for @AlonChatBot
- If missing, add it again
-
Group is verified:
- Go to Deploy > Telegram in AlonChat
- Check that the group status shows "Verified"
- If not verified, the link code may not have been detected -- try regenerating it
-
Auto-reply is enabled:
- Check the toggle for the specific group
- Ensure it is turned on
-
Agent is trained:
- Go to Sources
- Ensure the agent has been trained with content
Group Shows "Not Verified"#
Causes:
- @AlonChatBot was not added to the group
- The link code expired or was entered incorrectly
- The bot was removed from the group
Fix:
- Regenerate the link code from Deploy > Telegram
- Re-add @AlonChatBot to the Telegram group
- Wait for auto-detection (polls every 5 seconds)
Bot Responds to Every Message#
If the bot is responding to messages it should not:
- Review your agent's system prompt for specificity
- Add instructions like "Only respond to questions directed at you or relevant to [topic]"
- Consider using the
/startcommand model where users must initiate
Slow Responses#
Possible causes:
- AI model speed -- Switch to a faster model in Settings > AI
- Large source library -- Optimize by removing duplicate content
- Telegram API delays -- Occasional, usually resolves on its own
Privacy and Security#
- Messages processed by AlonChat are encrypted in transit and at rest
- AlonChat only accesses messages in groups where @AlonChatBot is a member
- No access to private messages between Telegram users
- You can disconnect any group at any time
- Conversation data can be deleted on request
Next Steps#
- Facebook Messenger Integration -- Connect Facebook
- Instagram Integration -- Connect Instagram
- WhatsApp Integration -- Connect WhatsApp
- Actions Overview -- Enable booking and more