back to blog
tutorials3 min read

How to Set Up Your Telegram AI Bot with OpenClaw

A step-by-step guide to creating a Telegram bot, connecting it to your OpenClaw instance, and having your first AI-powered conversation.

Telegram is one of the most popular ways to interact with your OpenClaw AI agent. In this tutorial, we'll walk through the entire process, from creating your bot on Telegram to having your first conversation.

Prerequisites

Before you start, you'll need:

  • A MyOpenClaw account with an active instance (sign up at myopenclaw.io)
  • The Telegram app installed on your phone or desktop
  • An AI provider API key (OpenAI, Anthropic, or another supported provider)

Step 1: Create Your Bot with BotFather

Every Telegram bot starts with BotFather, Telegram's official tool for creating and managing bots.

  1. Open Telegram and search for @BotFather
  2. Start a conversation and send /newbot
  3. BotFather will ask for a display name. This is what users see (e.g., "My AI Assistant")
  4. Then it asks for a username, which must end in "bot" (e.g., "my_ai_assistant_bot")
  5. BotFather gives you an API token that looks like 123456789:ABCdefGhIjKlMnOpQrStUvWxYz

warning

Keep your bot token secret. Anyone with this token can control your bot. If it's ever compromised, use /revoke with BotFather to generate a new one.

Step 2: Configure Your OpenClaw Instance

Now head to your MyOpenClaw dashboard and open the bot creation wizard:

  1. Click "create bot" on your dashboard
  2. Enter your Telegram bot token from Step 1
  3. Enter your AI provider API key (e.g., your OpenAI API key)
  4. Optionally customize your bot's system prompt, which defines your agent's personality and behavior
  5. Click "deploy"

MyOpenClaw will automatically configure your OpenClaw instance with the Telegram channel enabled and your bot token connected.

Step 3: Test Your Bot

Open Telegram and find your bot by searching for the username you chose in Step 1. Start a conversation:

  1. Click "Start" or send /start
  2. Send a message like "Hello! What can you do?"
  3. Your AI agent should respond within a few seconds

If everything is working, you'll see a response from your AI model, delivered through your OpenClaw instance.

Step 4: Customize Your Bot (Optional)

Set a Profile Picture

Back in BotFather, send /setuserpic and select your bot. Upload a profile picture to make your bot look polished.

Set a Description

Use /setdescription in BotFather to set what users see when they first open your bot, before they click Start.

Configure Commands

Use /setcommands to define slash commands for your bot. Common ones:

start - Start a conversation
help - Show available commands
reset - Clear conversation history

Troubleshooting

Bot doesn't respond?

  • Check that your OpenClaw instance status is "running" in the MyOpenClaw dashboard
  • Verify your Telegram bot token is correct
  • Make sure your AI provider API key is valid and has credits

Slow responses?

  • Response time depends on your AI provider. GPT-4 is slower than GPT-3.5
  • Check your instance health in the dashboard

Want to start fresh?

  • Send /reset to clear your conversation history
  • Or reconfigure through the MyOpenClaw dashboard

What's Next?

Now that your Telegram bot is running, explore what your AI agent can do:

  • Add skills to give your agent new capabilities
  • Customize the system prompt to match your workflow
  • Connect additional channels like WhatsApp or Discord
  • Check out our guide on OpenClaw Skills to extend your agent's abilities

ready to deploy your agent?

set up in under 60 seconds. cancel anytime.

get started
7-day money-back guarantee