All Integrations
✈️

Telegram AI Assistant: Complete Guide with OpenClaw

Build a powerful Telegram AI assistant that works for you around the clock

Telegram's Bot API is one of the most developer-friendly platforms for building AI assistants. With over 900 million monthly active users, Telegram offers an enormous audience for your AI-powered bot β€” whether for personal productivity, customer support, or community management.

OpenClaw makes it easy to create a self-hosted Telegram AI assistant that connects to any AI provider. Your bot runs on your infrastructure, ensuring message privacy and giving you complete control over the AI behavior, costs, and data.

What You'll Build

  • A Telegram bot with natural language understanding and multi-turn conversations
  • Support for both private chats and group conversations
  • Inline mode for AI-powered responses in any chat
  • Self-hosted with full privacy β€” no third-party data processing

Setup Guide

1

Step 1: Install OpenClaw

Deploy OpenClaw using Docker:

docker pull openclaw/openclaw:latest
docker run -d --name openclaw -p 8080:8080 openclaw/openclaw:latest

For other methods, check the Quick Start Guide.

2

Step 2: Create a Telegram Bot

Creating a Telegram bot takes less than 2 minutes:

  1. Open Telegram and search for @BotFather
  2. Send /newbot and follow the prompts
  3. Choose a display name and username ending in "bot"
  4. BotFather will give you a Bot Token β€” save it securely
  5. Send /setcommands to register bot commands:
    ask - Ask the AI a question
    summarize - Summarize text or article
    translate - Translate text
    help - Show available commands
3

Step 3: Configure OpenClaw Channel

Add the Telegram channel to openclaw.json:

{
  "channels": [
    {
      "type": "telegram",
      "name": "my-telegram-bot",
      "token": "123456:ABC-DEF_your_bot_token",
      "allowed_updates": ["message", "callback_query"],
      "default_skill": "chat",
      "group_mode": "mention_only"
    }
  ]
}

The group_mode: "mention_only" setting means the bot only responds when mentioned in groups, avoiding noise.

4

Step 4: Set Up Webhook (Recommended)

For production, use webhooks instead of polling:

curl -X POST "https://api.telegram.org/bot{YOUR_TOKEN}/setWebhook" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://your-server.com/api/telegram/webhook"}'

Webhooks are recommended for production as they reduce latency, lower server resource usage, and scale better.

5

Step 5: Configure AI Skills

Set up skills tailored for Telegram's mobile-first experience:

{
  "skills": {
    "chat": {
      "provider": "openai",
      "model": "gpt-4",
      "system_prompt": "You are a helpful assistant on Telegram. Keep responses concise (under 200 words).",
      "max_tokens": 500
    },
    "translate": {
      "provider": "anthropic",
      "model": "claude-3-haiku",
      "system_prompt": "Translate the following text. Detect the source language automatically."
    }
  }
}
6

Step 6: Test and Go Live

Restart OpenClaw and start chatting:

docker restart openclaw
  1. Open Telegram and find your bot by username
  2. Send /start to initialize the conversation
  3. Try asking a question
  4. Test commands: /summarize [paste article URL]
  5. Add the bot to a group and test mention responses

For high-availability deployment, see our Deployment Guide.

Use Cases

Personal AI Assistant

Your private AI companion on Telegram β€” ask questions, get translations, summarize articles, and brainstorm ideas on the go.

Customer Support Bot

Handle customer inquiries automatically with AI-powered responses. Support multiple languages for a global customer base.

Group Study Helper

Add the bot to study groups to explain concepts, quiz members, and summarize learning materials.

News & Content Digest

Send articles or links to the bot and get AI-generated summaries, key takeaways, and analysis.

Quick Configuration

{
  "gateway": { "mode": "local" },
  "ai": { "provider": "openai", "model": "gpt-4" },
  "channels": [
    {
      "type": "telegram",
      "name": "my-bot",
      "token": "123456:ABC-DEF",
      "group_mode": "mention_only"
    }
  ]
}

Frequently Asked Questions

Is there a message limit for Telegram bots?

Telegram allows bots to send up to 30 messages per second overall, and 1 message per second per chat. OpenClaw handles rate limiting automatically.

Can the bot handle images and files?

Currently, OpenClaw processes text messages from Telegram. Image analysis via multimodal AI models and file processing support are planned for upcoming releases.

How do I handle multiple languages?

OpenClaw can detect the user's language from their message and respond in the same language. Configure your AI skill's system prompt accordingly.

Can I run the bot on a Raspberry Pi?

Yes! OpenClaw is lightweight enough to run on a Raspberry Pi 4 (4GB RAM). Pair it with a local model via Ollama for a completely self-contained, private AI assistant.

Ready to Build Your AI Bot?

Get OpenClaw running in minutes and connect to your favorite platform.

Get Started with OpenClaw