$cd ../tutorials/
popularchannels15 min read β€’ March 2026
$ cat telegram-setup.md

export TelegramSetup

/** Create your own Telegram AI bot powered by self-hosted OpenClaw */

// Why Telegram over WhatsApp?
β€’ Official Bot API β€” free, no unofficial gateways needed
β€’ Voice messages β€” OpenClaw transcribes them automatically
β€’ Image & file support β€” send receipts, docs, photos for analysis
β€’ No ban risk β€” official integration, not a workaround
β€’ Inline buttons β€” richer interactive responses
section_01_botfather.md

## πŸ€– Create Your Bot with BotFather

Step 1: Open BotFather
Search for @BotFather in Telegram (the one with a verified blue checkmark) and tap /start.
Step 2: Create a new bot
Send /newbot. BotFather will ask for a name and then a username (must end in bot). Example: MyOpenClawBot.
Step 3: Save your bot token
BotFather will give you a token. Store this safely β€” it's the key to your bot.
7123456789:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw
section_02_user_id.md

## πŸͺͺ Get Your Telegram User ID

Your User ID is a unique number that identifies you. OpenClaw uses it to restrict bot access to only you.

1. Message @userinfobot in Telegram.
2. It replies with your info. Note your Id:
Id: 123456789
First: John
Username: @johndoe
section_03_config.yaml

## βš™οΈ Configure OpenClaw

Add the Telegram channel to your OpenClaw config:

# openclaw/config.yaml
channels:
telegram:
enabled: true
bot_token: "YOUR_BOT_TOKEN"
allowed_user_ids:
- 123456789 # Your Telegram user ID
enable_voice: true
enable_vision: true
Restart OpenClaw: docker restart openclaw
section_04_webhook.sh

## πŸ”— Set Up the Webhook

Telegram needs to know where to send messages. If your server is publicly accessible (VPS with a domain or Tailscale), use the webhook method for zero latency:

# Replace with your actual bot token and server URL
$ curl -X POST \
"https://api.telegram.org/botYOUR_BOT_TOKEN/setWebhook" \
-d "url=https://your-server.com/telegram/webhook"
// response: {"ok":true,"result":true,"description":"Webhook was set"}

// πŸ’‘ Running locally without a public URL? No problem. OpenClaw falls back to polling mode automatically β€” no webhook needed for local setups.

section_05_voice_vision.md

## πŸŽ™οΈ Enable Voice & Vision

This is where Telegram shines over other channels. OpenClaw can hear and see.

Voice Messages
Send a voice note β†’ OpenClaw uses Whisper (local or API) to transcribe it β†’ responds as text. Requires enable_voice: true and preferably a local Whisper model for privacy.
Image & Vision
Send a photo of a receipt, a whiteboard, or a document β†’ OpenClaw analyzes it using your configured vision model (GPT-4o, Claude, or local LLaVA).
File Analysis
Send PDFs, CSVs, or text files. Telegram allows up to 2GB file uploads via bots (20MB for inline). For large files, mount a shared directory instead.
section_06_test.md

## πŸ§ͺ Test Your Bot

Open Telegram, search for your bot by username, and send some test messages:

You β†’ /start
Bot β†’ 🦞 OpenClaw online. How can I help?
You β†’ Summarize the top HackerNews posts today
Bot β†’ Fetching... Here are today's top 5 stories on HN:
1. "Llama 4 released with 400B parameters..."
2. "Why Rust won the systems programming war..."
...
Useful bot commands to set up via BotFather (/setcommands):
/status β€” Check OpenClaw status
/memory β€” View conversation memory
/clear β€” Clear context
/model β€” Switch AI model
$ cd ../tutorials/* END_OF_TUTORIAL */