I Replaced a $30/Month Live Chat Tool with a Telegram Bot on WordPress

php dev.to

Every WordPress live chat tool I looked at cost money. A lot of it.

  • Tidio: $29/month
  • LiveChat: $24/month per agent
  • Crisp: $25/month
  • Intercom: don't even ask

As a solo developer just launching a WordPress plugin shop, I was going to spend more on the chat tool than I'd make in my first month of sales.

So I looked at what these tools actually do.

A visitor types a message → it goes to their server → their server pings my phone → I reply → it goes back through their server → visitor sees it.

That's it. That's the whole service. $300/year for a relay.

The Alternative

Telegram's Bot API does the same thing. For free.

So I built a WordPress plugin that connects directly to it — no relay server, no third-party storage, no monthly fee.

How it works:

  1. Visitor sends a message on your WordPress site
  2. Plugin sends it to your Telegram bot via Bot API
  3. You get an instant Telegram notification on your phone
  4. You reply in Telegram
  5. Visitor sees your reply on the site in real time

That's the whole flow. Nothing in between.

Technical Implementation

For anyone curious about the internals:

  • Webhook-based — not polling. Telegram sends events to your server instantly
  • Encrypted token storage — bot token encrypted with AES-256-CBC using your WordPress secret key before database storage
  • Local conversation history — all chats stored in your own WordPress database, full history in WP admin
  • Unlimited agents — add your whole team to a Telegram group, no per-seat pricing
  • No external dependency except Telegram API itself
// Simplified webhook handler
public function handle_webhook() {
    $payload = json_decode( file_get_contents( 'php://input' ), true );

    if ( isset( $payload['message'] ) ) {
        $chat_id = $payload['message']['chat']['id'];
        $text    = $payload['message']['text'];

        // Store message, notify admin via Telegram
        $this->store_message( $chat_id, $text );
        $this->notify_admin( $chat_id, $text );
    }
}
Enter fullscreen mode Exit fullscreen mode

What It Can't Do

Being honest here:

  • No AI chatbot or automated responses
  • No proactive messaging (you can't initiate conversations)
  • Requires a Telegram account
  • No fancy analytics dashboard

If you need AI responses or have a large support team with complex routing, a dedicated tool is worth the cost.

But if you're a solo developer or small team who just needs to answer customer questions quickly — Telegram is already on your phone, notifications are instant, and the setup takes 5 minutes.

The Result

I've been running this on my own site for months. It works. The notification is faster than most dedicated tools. I haven't paid a single monthly fee.

I packaged it as a plugin called WP-TG Live Support Chat.

Demo: https://tglivechat.for-wordpress.org — you can actually send a message and see the flow.

Product page: https://for-wordpress.org/product/wp-tg-live-support-chat-plugin-turn-telegram-into-your-free-live-chat-helpdesk/

The Broader Point

Before paying for any SaaS tool, ask what it's actually doing.

A lot of them are sitting between two free APIs, charging you monthly for the connection. Sometimes the middleware is worth it — great UI, reliability guarantees, dedicated support.

But sometimes you can build the connection yourself in a weekend and own it forever.


Have you replaced a SaaS tool with something you built yourself? What was it?

Source: dev.to

arrow_back Back to Tutorials