๐Ÿ”—Integration & Channels

How to Set Up an OpenClaw Telegram Bot

Beginner30-60 minutesUpdated 2025-01-18

Telegram bots are one of the easiest ways to make OpenClaw accessible to your team or customers. This beginner-friendly guide walks you through creating a bot with BotFather, configuring OpenClaw for Telegram, and setting up webhooks, commands, and group support.

Why This Is Hard to Do Yourself

These are the common pitfalls that trip people up.

๐Ÿค–

BotFather workflow

Creating a Telegram bot requires specific commands in a specific order through BotFather

๐Ÿ”—

Webhook vs polling

Two different methods with different tradeoffs. Webhooks need HTTPS, polling is simpler but slower.

๐Ÿ‘ฅ

Group vs DM behavior

Bots behave differently in groups vs direct messages. Privacy mode, command parsing, and mention detection all vary.

Step-by-Step Guide

Step 1

Create a bot with BotFather

# Open Telegram and message @BotFather
# Send: /newbot
# Follow prompts to set name and username
# Save the API token: 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11

Warning: Never share your bot token publicly. Anyone with the token can control your bot.

Step 2

Configure OpenClaw for Telegram

# In config/channels/telegram.yaml:
telegram:
  enabled: true
  bot_token: "YOUR_BOT_TOKEN"
  mode: webhook  # or "polling" for development
  webhook_url: "https://your-domain.com/webhooks/telegram"
  allowed_users: []  # Empty = allow all, or list Telegram user IDs
Step 3

Set up the webhook

# Register webhook with Telegram:
curl -X POST "https://api.telegram.org/botYOUR_TOKEN/setWebhook" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://your-domain.com/webhooks/telegram"}'
Step 4

Configure bot commands

# Set bot commands via BotFather:
# /setcommands
# Select your bot, then send:
start - Start a conversation
help - Show available commands
reset - Clear conversation history
status - Check bot status
Step 5

Test the bot

# Message your bot on Telegram
# Check OpenClaw logs:
tail -f ~/.openclaw/logs/channels.log | grep telegram

Want a Polished Telegram Bot?

Our integration experts set up Telegram bots with custom commands, group support, inline mode, and error handling. Get a production-ready bot, not a bare-bones setup.

Get matched with a specialist who can help.

Sign Up for Expert Help โ†’

Frequently Asked Questions