MxChat Telegram Integration

Connect your MxChat chatbot to Telegram for live agent support. When visitors request human help, conversations are routed to your Telegram supergroup where agents can respond in real-time.

📋 Requirements
  • MxChat plugin installed and activated
  • Active MxChat Pro license
  • Telegram account (free)
  • SSL certificate on your website (https://)

Quick Setup

Follow these steps to connect MxChat to Telegram. The entire setup takes about 5 minutes.

  1. Create a Telegram Bot

    Open Telegram and search for @BotFather. Send the command /newbot and follow the prompts to name your bot.

    BotFather will give you a Bot Token that looks like this:

    7123456789:AAHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    Save this token – you’ll need it in step 4.

  2. Create a Supergroup with Topics

    Create a new Telegram group and convert it to a supergroup with topics enabled:

    • Create a new group in Telegram
    • Add your bot (the one you just created) to the group
    • Open group settings and enable “Topics”
    • Make your bot an administrator with permission to manage topics
    ✅ Tip

    When creating the group, add your bot immediately. This ensures the bot can see all messages from the start.

  3. Get Your Group ID

    Add @raw_data_bot to your group temporarily. It will display your group’s chat ID, which looks like:

    -1001234567890

    Copy this ID, then remove @raw_data_bot from the group.

  4. Configure MxChat Settings

    In your WordPress admin, go to MxChat → Settings → Telegram and enter:

    Setting Value
    Bot Token Your token from BotFather
    Group Chat ID Your supergroup ID (starts with -100)
    Webhook Secret Any random string (auto-generated)

    Click Save Settings.

  5. Set the Webhook

    Click the “Set Webhook” button in MxChat settings. This tells Telegram where to send messages from your agents.

    You should see a success message. Your integration is now active!

💡 That’s it!

When a visitor requests a live agent on your website, a new topic will be created in your Telegram group. Your agents can reply directly in Telegram and messages will appear on your website in real-time.

Core Features

🗂️ Organized Topics

Each visitor conversation gets its own forum topic. No message chaos – just clean, organized support threads.

🔄 Real-Time Sync

Messages sync instantly between your website and Telegram. Visitors see agent replies immediately.

📱 Mobile Support

Agents respond from the Telegram app on any device. No special software or dashboard needed.

🔒 Secure Webhooks

Secret token verification ensures only legitimate messages from Telegram are processed.

📜 Context Transfer

Conversation history is automatically shared with agents so they have full context.

🤖 AI Fallback

Visitors can switch back to AI assistance anytime by typing “Switch to AI” in the chat.

How It Works

Here’s the flow when a visitor requests live agent support:

  1. Visitor Requests Help

    A visitor clicks “Talk to a human” or types a request for live support in your chatbot.

  2. Topic Created

    MxChat creates a new topic in your Telegram supergroup with the visitor’s session info and conversation history.

  3. Agent Responds

    Any team member in the Telegram group can reply to the topic. Their message is sent to the visitor.

  4. Conversation Continues

    Messages flow bidirectionally until the conversation ends or the visitor switches back to AI.

Telegram Setup Details

Bot Permissions

Your bot needs the following admin permissions in the supergroup:

  • Manage Topics – Create new topics for each conversation
  • Send Messages – Post visitor messages to topics
  • Delete Messages – Optional, for cleanup

Converting to Supergroup

If your group isn’t already a supergroup, Telegram will automatically convert it when you enable topics. You can also manually convert by:

  1. Opening group settings
  2. Going to “Group Type”
  3. Selecting “Supergroup”
⚠️ Important

Topics must be enabled for the integration to work. Regular groups without topics are not supported because we need separate threads for each visitor conversation.

MxChat Settings

Setting Description Required
Bot Token The API token from BotFather for your Telegram bot Yes
Group Chat ID Your supergroup’s numeric ID (starts with -100) Yes
Webhook Secret Random string for webhook verification (auto-generated) Yes
Away Message Message shown when no agents are available No
Welcome Message Initial message when live chat connects No

Webhook Setup

The webhook allows Telegram to send agent messages to your website. MxChat handles this automatically when you click “Set Webhook”.

Manual Webhook Setup

If automatic setup fails, you can set the webhook manually using this URL in your browser:

https://api.telegram.org/bot<YOUR_BOT_TOKEN>/setWebhook?url=https://yoursite.com/wp-json/mxchat/v1/telegram-webhook&secret_token=<YOUR_SECRET>

Replace:

  • <YOUR_BOT_TOKEN> with your actual bot token
  • yoursite.com with your domain
  • <YOUR_SECRET> with your webhook secret

Verify Webhook Status

Check if your webhook is set correctly:

https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getWebhookInfo

Troubleshooting

Messages not appearing on website

Agent replies in Telegram aren’t showing on the visitor’s chat widget.

Solution:

1. Verify the webhook is set correctly using getWebhookInfo
2. Ensure your site has a valid SSL certificate (https)
3. Check that your webhook secret in MxChat matches what was sent to Telegram

Topics not being created

When visitors request live chat, no topic appears in the Telegram group.

Solution:

1. Confirm your bot is an admin in the supergroup
2. Verify the bot has “Manage Topics” permission
3. Double-check the Group Chat ID is correct (should start with -100)

Webhook returns 401/403 error

The webhook endpoint is rejecting messages from Telegram.

Solution:

1. Regenerate the webhook secret in MxChat settings
2. Click “Set Webhook” again to update Telegram
3. If using a security plugin, whitelist the webhook endpoint

Bot not responding in group

The bot was added to the group but doesn’t react to anything.

Solution:

1. Remove and re-add the bot to the group
2. Make sure the bot is set as administrator
3. Check that “Group Privacy” is disabled for the bot in BotFather (/setprivacy → Disable)

Frequently Asked Questions

Do I need a paid Telegram account?

+

No. Telegram is completely free for personal and business use. Creating bots and supergroups costs nothing.

How many agents can use the Telegram group?

+

Unlimited. Anyone in the supergroup can see and respond to visitor conversations. Messages show which agent sent them.

What happens when all agents are offline?

+

Visitors see your configured “away message.” They can also type “Switch to AI” to return to chatbot assistance anytime.

Can I use Telegram and Slack at the same time?

+

Currently, only one live agent integration can be active at a time. Choose the platform your team prefers.

Are conversations saved?

+

Yes. All messages are stored in MxChat conversation history on your WordPress site. Telegram also keeps a copy in your supergroup topics.

Can visitors send images or files?

+

Currently, the integration supports text messages. Image and file sharing may be added in future updates.

🚀 Ready to get started?

Download the MxChat Telegram add-on and follow the Quick Setup guide above. Most users complete setup in under 5 minutes!