Quick Start in 3 Steps

Step 1 — Create your bot: Message @BotFather on Telegram, send /newbot, and save the token.

Step 2 — Configure OpenClaw:

openclaw config set telegram.bot_token "YOUR_TOKEN"
openclaw config set telegram.allowed_users "YOUR_TELEGRAM_ID"

Step 3 — Start and test:

openclaw start --telegram
# Then send to your bot: /run Summarize today's top AI news

Prerequisites

Step 1: Create a Bot via BotFather

  1. Open Telegram and search for @BotFather
  2. Send /newbot and follow prompts to name your bot
  3. Copy the API token that BotFather provides (e.g. 123456789:ABCdef...)
  4. Get your personal chat ID: message @userinfobot to receive your numeric ID
⚠️
Security Note

Always set telegram.allowed_users in your config to restrict bot access to your personal Telegram ID only.

Step 2: Install the Telegram Pack

openclaw install telegram

Step 3: Configure

openclaw config set telegram.bot_token "123456789:ABCdef..."
openclaw config set telegram.allowed_users "YOUR_TELEGRAM_USER_ID"
# config.yaml
integrations:
  telegram:
    bot_token: "${TELEGRAM_BOT_TOKEN}"
    allowed_users:
      - 123456789    # your numeric Telegram ID
    mode: polling    # polling or webhook
    poll_interval: 2 # seconds

Bot Commands

CommandDescription
/run <task>Execute an AI task
/statusCheck current job status
/stopStop the running job
/helpShow available commands
/config provider <name>Switch AI provider

Step 4: Start the Bot

# Start OpenClaw with Telegram integration enabled
openclaw start --telegram

Now send /run Summarize today's top tech news to your bot in Telegram.

Webhook vs Polling

Polling is simpler — OpenClaw regularly asks Telegram for new messages. Works on any network.

Webhook is more efficient — Telegram pushes messages immediately. Requires a public HTTPS endpoint.

integrations:
  telegram:
    mode: webhook
    webhook_url: https://api.your-domain.com/telegram/webhook

Scheduled Tasks and Reports

Set up OpenClaw to send you automated reports via Telegram at a scheduled time:

# config.yaml
integrations:
  telegram:
    bot_token: "${TELEGRAM_BOT_TOKEN}"
    allowed_users:
      - 123456789
    scheduled_reports:
      - cron: "0 9 * * *"       # Daily at 9:00 AM
        task: "Summarize yesterday's news headlines"
      - cron: "0 17 * * 5"     # Every Friday at 5 PM
        task: "Generate a weekly productivity summary"
# Or use the CLI to send a one-off message
openclaw telegram send "Backup complete. 42 files processed."

Common Use Cases

  • Remote monitoring — check server status from your phone: /status
  • AI writing assistant — draft emails or reports on the go: /run Write a reply to this email: [paste]
  • Code review — paste a snippet and ask for a review: /run Review this Python code for bugs
  • Daily briefing — auto-send a morning digest at 8 AM with scheduled tasks
  • Notification system — trigger Telegram alerts from scripts or CI/CD pipelines

Security Best Practices

⚠️
Always restrict access

Without allowed_users, anyone who knows your bot token can send it commands. Always set this to your personal Telegram ID.

  • Store the bot token in an environment variable: TELEGRAM_BOT_TOKEN
  • Never commit the token to version control or config files checked into git
  • Use a separate bot for each environment (dev, staging, production)
  • Rotate the bot token via @BotFather/revoke if compromised
  • Enable two-factor authentication on your Telegram account

Multi-User Access

Grant access to multiple Telegram users (e.g., a team):

integrations:
  telegram:
    allowed_users:
      - 123456789   # Your personal ID
      - 987654321   # Teammate
    permission_levels:
      123456789: admin    # can run, stop, and configure
      987654321: viewer   # can only check /status

Troubleshooting

ProblemCauseFix
Bot doesn't respondToken invalid or bot not startedVerify token; run openclaw start --telegram
"Unauthorized" errorBot token revokedGenerate new token via @BotFather → /token
Commands ignoredUser ID not in allowed_usersAdd your user ID (get it from @userinfobot)
Webhook not receivingPublic URL unreachable or HTTP-onlyUse polling mode, or ensure HTTPS endpoint is accessible
Slow responseHigh poll_intervalLower poll_interval to 1 second in config

Try It Yourself

Once your Telegram bot is running, test these commands directly from the Telegram app on your phone or desktop.

Example 1: Run a task from Telegram while away from your computer

# In Telegram, message your bot:
/run Summarise yesterday's git commits in my main project

# OpenClaw runs on your server and replies:
# ✅ Done. Yesterday's commits:
# - feat: add dark mode toggle (3 files)
# - fix: correct timeout in API client
# - docs: update README with new config options

Example 2: Schedule a daily briefing via Telegram

# Add to cron (runs on your server, sends result to Telegram)
# crontab -e
0 8 * * 1-5 openclaw run "Generate a brief morning standup: yesterday's work, today's priorities, blockers" \
  --path ~/projects/main/ \
  | openclaw telegram send "🌅 Daily Briefing
$(cat)"

Example 3: Receive alerts from automated scripts

#!/usr/bin/env bash
# deploy.sh — send Telegram notification after deployment
./scripts/deploy.sh

if [ $? -eq 0 ]; then
  openclaw telegram send "✅ Deployment succeeded: v$(cat VERSION) is live"
else
  openclaw telegram send "❌ Deployment FAILED — check logs at /var/log/deploy.log"
fi
Get your Telegram user ID: Message @userinfobot on Telegram — it instantly replies with your numeric user ID. Add it to allowed_users in your OpenClaw config.

What's Next