How to Create a Telegram Bot with BotFather

This guide explains how to create a Telegram bot with BotFather, generate the bot token, and prepare it for Telegram integration with OpenClaw.

Do not index
notion image
 
If you want to connect Telegram with OpenClaw, the first thing you need is a Telegram bot. And to create that bot, Telegram gives you an official tool called BotFather.
It sounds a little dramatic, maybe. But yes, BotFather is the bot that creates other bots.
In this guide, I’ll walk you through how to create a Telegram bot with BotFather, how to get the bot token, and how that token is later used inside OpenClaw.

Why You Need BotFather

Before OpenClaw can send or receive Telegram messages, it needs a Telegram bot identity.
That bot identity includes:
  • a bot name
  • a bot username
  • a unique bot token
BotFather is the official Telegram bot used to generate all of that.
So, really, if you skip this part, nothing else works.

What You’ll Need

Before starting, make sure you have:
  • a Telegram account
  • the Telegram app or web version open
  • access to BotFather
  • a bot name in mind
  • a unique username ending in bot

Step 1: Open Telegram and Search for BotFather

Open Telegram and search for:
@BotFather
This is Telegram’s official bot management tool.
Once you open the chat, click Start if you haven’t used it before.

Step 2: Create a New Bot

Inside the BotFather chat, type:
/newbot
BotFather will then ask you for two things:
  1. Bot name
  1. Bot username
The bot name can be anything readable, like:
My OpenClaw Assistant
The username must be unique and must end in bot, for example:
my_openclaw_helper_bot
If the username is already taken, BotFather will ask you to try something else.
That part can be a little annoying, honestly, but it only takes a few tries usually.

Step 3: Example BotFather Flow

A typical BotFather setup looks like this:

Command to create a bot

/newbot

Example bot name

My OpenClaw Assistant

Example bot username

my_openclaw_helper_bot
If successful, BotFather sends a confirmation message and gives you the bot token.

Step 4: Copy the Telegram Bot Token

Once your bot is created, BotFather will send a message that includes something like this:
Use this token to access the HTTP API:
123456789:ABCdefGhIJKlmNoPQRsTUvWXyz123456789
That long string is your Telegram bot token.
It’s important.
You’ll need to copy it and store it safely because OpenClaw uses it later to connect your Telegram bot.
A token looks like this format:
<bot_id>:<secret_token>
Example:
7923339655:AAGMA8fje_GX2AL0Z53R6cq6ZvUg1vSJz-U
Do not share this publicly. Anyone with that token can control your bot.

Step 5: Optional BotFather Commands

After creating the bot, you can also use BotFather to customize it further.
Some useful commands include:
/setdescription
/setabouttext
/setuserpic
/mybots
These are optional, but they help make the bot look more polished.
For example, if you want your Telegram bot to feel more professional before connecting it to OpenClaw, adding a description is a nice touch.

Step 6: Save the Token for OpenClaw Setup

Once you have the token, keep it ready for the OpenClaw setup process.
When configuring Telegram in OpenClaw, you’ll be asked to enter the bot token.
The prompt usually looks like this:
Enter Telegram bot token
And then you paste the token directly.
Example:
7923339655:AAGMA8fje_GX2AL0Z53R6cq6ZvUg1vSJz-U
After that, OpenClaw continues the Telegram channel setup.

Step 7: What Happens After the Token Is Added

Once the token is entered into OpenClaw:
  • Telegram becomes a selected channel
  • OpenClaw updates its configuration
  • your bot becomes ready for pairing or approval
  • Telegram messages can start flowing into your AI setup
In some setups, the system may then ask you to configure access policies or approve Telegram pairing.
So creating the bot with BotFather is really the first half of the Telegram integration.

Simple Command Summary

Here’s the short version if you just want the essentials.

Start BotFather

@BotFather

Create a new bot

/newbot

Then provide

Bot name
Bot username ending in "bot"

Copy the generated token

123456789:ABCdefGhIJKlmNoPQRsTUvWXyz123456789

Use that token later in OpenClaw

Enter Telegram bot token

Common Mistakes to Avoid

A few things go wrong pretty often here:

1. Username does not end in bot

Telegram requires bot usernames to end in bot.
Valid example:
myhelperbot
or
my_helper_bot
Invalid example:
myhelperassistant

2. Username is already taken

This is very common. Just try another variation.

3. Token is copied incorrectly

Make sure you copy the full token exactly as BotFather gives it.

4. Token is shared publicly

Never paste your real token into public docs, screenshots, or blog posts.

Best Practices

A few small suggestions here. They help more than people think.
  • Use a clear bot name
  • Choose a username that matches your brand or use case
  • Store the token in a safe place
  • Avoid sharing screenshots with the full token visible
  • Test the bot in Telegram before connecting it to OpenClaw
If the bot opens and responds in Telegram, you’re in good shape.

How This Fits into OpenClaw Setup

If you’re using OpenClaw, creating the Telegram bot with BotFather is part of the Telegram channel setup flow.
The general process looks like this:
  1. Create bot in BotFather
  1. Copy the bot token
  1. Open OpenClaw terminal
  1. Select Telegram channel
  1. Paste token
  1. Complete pairing or approval
  1. Test the bot
So while this article focuses on BotFather, it connects directly to the larger Telegram integration workflow.

Final Thoughts

Learning how to create a Telegram bot with BotFather is straightforward once you know the sequence.
You open BotFather, run /newbot, choose a name, choose a username, and copy the generated token. That’s really it.
From there, the token becomes the bridge between Telegram and OpenClaw.
It’s a small setup step, but an important one. Without it, the rest of the Telegram connection just stalls.