DEV Community

Cover image for How to Turn Any SaaS Into a Telegram Bot in 30 Minutes Using OpenClaw
Shirisha Uppoju
Shirisha Uppoju

Posted on

How to Turn Any SaaS Into a Telegram Bot in 30 Minutes Using OpenClaw

OpenClaw Challenge Submission 🦞

This is a submission for the DEV OpenClaw Challenge 2026: Wealth of Knowledge

The Problem Every SaaS Founder Has

You built a beautiful web app. Users love it. But friction is real: they have to open the browser, navigate to your site, log in, and then use your product.

What if they could just message you on Telegram?

Last week I gave my meal planning SaaS MealAI a Telegram interface using OpenClaw. It took 30 minutes. No webhook hosting. No bot framework to learn. No custom API glue code.

Here is exactly how I did it, and how you can do the same for any SaaS.

What You Will Build

A Telegram bot that:

  • Talks in your product's voice (not generic ChatGPT)
  • Has your product's domain expertise baked in
  • Responds with branded formatting (emojis, bold, structure)
  • Can be extended to call your real APIs

Time: 30 minutes
Cost: Free (Docker + OpenAI API credits)
Prerequisites: Basic Docker knowledge, an OpenAI or Anthropic API key

Why OpenClaw?

Before OpenClaw, building a Telegram AI bot meant:

  • A Node.js backend with grammY or telegraf
  • A hosted webhook endpoint
  • Custom prompt management
  • Session and memory handling
  • Rate limiting logic
  • Deployment pipeline

OpenClaw is an MIT licensed AI agent runtime that handles all of this in one binary. It supports 25 plus messaging platforms (Telegram, WhatsApp, Discord, Slack, Signal, iMessage, and more). Your agent works on any of them without code changes.

Think of it as the WordPress of AI agents for messaging.

Step 1: Install Docker (2 min)

On macOS, I recommend OrbStack. It is lighter than Docker Desktop.

brew install --cask orbstack
open -a OrbStack

On Linux or Windows, use Docker Desktop.
Verify it works:
Enter fullscreen mode Exit fullscreen mode


bash
docker --version

Step 2: Pull OpenClaw (2 min)

Create a working directory:

mkdir mealai-concierge && cd mealai-concierge

Pull the pre built image:
Enter fullscreen mode Exit fullscreen mode


bash
docker pull ghcr.io/openclaw/openclaw:latest

Step 3: Create a Telegram Bot (3 min)

  1. Open Telegram, search for @botfather
  2. Send /newbot
  3. Choose a name and username (must end in _bot)
  4. Copy the HTTP API token Your bot URL will be t.me/your_bot_username. ## Step 4: Configure OpenClaw (5 min) Create a docker-compose.yml:
services:
openclaw-gateway:
image: ghcr.io/openclaw/openclaw:latest
environment:
HOME: /home/node
TZ: UTC
volumes:
- ./openclaw-config:/home/node/.openclaw
- ./openclaw-workspace:/home/node/.openclaw/workspace
ports:
- "18789:18789"
- "18790:18790"
init: true
restart: unless-stopped
command:
- node
- dist/index.js
- gateway
- --bind
- lan
- --port
- "18789"

Create openclaw-config/openclaw.json:
Enter fullscreen mode Exit fullscreen mode


json
{
"gateway": {
"mode": "local"
},
"channels": {
"telegram": {
"enabled": true,
"botToken": "YOUR_TELEGRAM_BOT_TOKEN_HERE",
"dmPolicy": "open",
"allowFrom": ["*"]
}
},
"agents": {
"defaults": {
"model": "openai/gpt-4o-mini"
}
}
}

Create openclaw-config/agents/main/agent/auth-profiles.json:

{
"version": 1,
"profiles": {
"openai:default": {
"type": "api_key",
"provider": "openai",
"key": "sk-YOUR_OPENAI_KEY_HERE"
}
}
}

## Step 5: The Secret Sauce, SOUL.md (10 min)
This is where a generic chatbot transforms into your product's voice.
Create openclaw-workspace/SOUL.md:
Enter fullscreen mode Exit fullscreen mode


markdown
SOUL.md MealAI Concierge
You are MealAI Concierge, a friendly AI meal planning assistant.

Your Role
Help busy people answer: "What's for dinner?" and plan their week.

Personality
Warm, conversational, concise
Opinionated about food (no hedging)
Practical over perfect
Real people eat real food
What You Do Best
Suggest meal plans (day or week)
Build grocery lists grouped by store section
Adapt to preferences (vegetarian, budget, high protein, picky kids)
Explain nutrition simply
Recipe quick hits, ingredients plus 5 steps
Response Format
Bold meal names
Sparse emojis (salad, pasta, breakfast)
Under 200 words unless asked for detail
Rules
Never open with "Great question!", just answer
Redirect off topic: "That is outside my kitchen!"
Always end with a follow up: "Want the grocery list?"
Mention usemealai.com for full features
Why SOUL.md is powerful:
OpenClaw injects this at the system prompt level on every conversation. The model always sees these instructions before user messages. This is why the persona stays consistent. It is not fine tuning, it is prompt engineering at the right architectural layer.

Step 6: Start It Up (1 min)

docker compose up -d

Check the logs:
Enter fullscreen mode Exit fullscreen mode


bash
docker compose logs -f openclaw-gateway

You should see:
[telegram] [default] starting provider (@YourBotName_bot)

Step 7: Test It (2 min)

Open Telegram, find your bot, and say:

  • "Hi, who are you?"
  • "What is for dinner tonight?"
  • "I am vegetarian, plan my week" You will see it responds as your product, not as ChatGPT. ## The Magic Revealed Here is what OpenClaw is doing under the hood: User message (Telegram) -> OpenClaw Gateway (long polling Telegram API) -> System prompt assembly:

Your SOUL.md (persona)
Your IDENTITY.md (name, vibe)
Conversation history
->
Routed to OpenAI gpt-4o-mini
->
Response sent back via Telegram API
You never wrote a single line of bot framework code. The entire integration layer is one SOUL.md file.

Next Level Moves

Once the basics work, you can layer on:

Add custom skills (call your real API)

Create an OpenClaw skill that fetches real meal plans from your SaaS database. OpenClaw has a plugin SDK that lets the agent decide when to call your API based on the user's message.

Multi channel in one line

Want the same bot on WhatsApp, Discord, or Signal? Add another entry to channels:


json
"channels": {
"telegram": { "enabled": true, "botToken": "..." },
"discord": { "enabled": true, "botToken": "..." },
"whatsapp": { "enabled": true }
}

One codebase. Every platform.
### Persistent memory
The openclaw-workspace directory is your bot's long term memory. Drop markdown files with user preferences, FAQs, or product knowledge. OpenClaw pulls from them contextually.
### Control UI dashboard
OpenClaw ships with a web dashboard at http://localhost:18789 where you can:
* See every conversation live
* Monitor API costs
* Debug prompts
* Switch models
## What I Learned
1. The prompt IS the product. SOUL.md is not just instructions. It is the difference between a demo and a product people want to use.
2. Messaging beats web apps for AI. Users never open Telegram. It is always open. Your SaaS suddenly has zero friction.
3. Open source AI runtimes are ready. OpenClaw handles production grade concerns (auth, rate limiting, logging, multi channel) out of the box.
4. Docker is enough. No Kubernetes. No serverless. Just docker compose up.
## The Repo
Full working setup (zero secrets included):

GitHub logo shopsmartai / mealai-concierge

AI meal-planning concierge via Telegram. Built with OpenClaw for DEV OpenClaw Challenge 2026.

🍳 MealAI Concierge

Your personal AI meal-planning assistant — right in Telegram.

Built with OpenClaw + ShopSmartAI for the DEV OpenClaw Challenge 2026.

Live at: usemealai.com

What it does

Ask "What's for dinner?" in Telegram and get:

  • 📅 Personalized weekly meal plans
  • 🛒 Grocery lists organized by store section
  • 🥗 Dietary adaptations (vegetarian, gluten-free, budget, etc.)
  • 🍳 Quick recipes with ingredients + steps

Architecture

User → Telegram → OpenClaw Gateway → OpenAI (gpt-4o-mini) → Response
                         ↓
                   Custom SOUL.md
                   (MealAI Concierge persona)

Quick Start

1. Prerequisites

2. Setup

# Clone this repo
git clone https://github.com/shopsmartai/mealai-concierge.git
cd mealai-concierge
# Copy example files
cp .env.example .env
cp openclaw.json.example openclaw-config/openclaw.json

# Edit .env with your OpenAI key
# Edit openclaw.json with your Telegram bot token

# Copy persona files into workspace
mkdir -p openclaw-workspace
cp SOUL.md IDENTITY.md openclaw-workspace/

#
Enter fullscreen mode Exit fullscreen mode

Clone it, add your tokens, and you will have a working meal bot in 10 minutes. Swap the SOUL.md for your product's domain and you have turned your SaaS into a Telegram bot.

See It Live

Try the live bot: t.me/Usemealai_bot
Check out MealAI: usemealai.com
If you found this helpful, leave a heart and tell me what SaaS you would wrap with OpenClaw. I would love to see what you build.

Enter fullscreen mode Exit fullscreen mode

Top comments (0)