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#

  1. Go to your agent dashboard
  2. Navigate to Deploy > Telegram
  3. Click Add Telegram Group
  4. Give the group a label (e.g., "Customer Support Group")

After creating the group:

  1. A link code is generated
  2. Copy the link code
  3. Follow the on-screen instructions to add the AlonChat bot to your Telegram group

Step 3: Add the Bot to Your Group#

  1. Open your Telegram group
  2. Add @AlonChatBot as a member
  3. The bot will automatically detect the group and verify the link code
  4. 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#

Code
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#

FeatureStatus
Text messagesSupported
Auto-replySupported
Human handoffSupported
Conversation historyTracked
Lead captureSupported
Multiple groupsSupported

Bot Commands#

Telegram users can use these commands in the group:

CommandDescription
/startStart a conversation with the agent
/helpDisplay help information and available commands
/humanRequest 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 /human command 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

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:

  1. Bot is a group member:

    • Open the group in Telegram
    • Check the member list for @AlonChatBot
    • If missing, add it again
  2. 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
  3. Auto-reply is enabled:

    • Check the toggle for the specific group
    • Ensure it is turned on
  4. 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:

  1. Regenerate the link code from Deploy > Telegram
  2. Re-add @AlonChatBot to the Telegram group
  3. 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 /start command model where users must initiate

Slow Responses#

Possible causes:

  1. AI model speed -- Switch to a faster model in Settings > AI
  2. Large source library -- Optimize by removing duplicate content
  3. 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#