If you see “BotFather” in OpenClaw guides and you’re thinking “cool, what is that?”, this article is for you.
BotFather is Telegram’s official bot management account. It creates Telegram bots and hands you a token. OpenClaw uses that token to connect your Telegram bot to your self-hosted agent running on a VPS or home server.
So the relationship is simple: BotFather creates the Telegram bot and OpenClaw is the brain that replies to messages through it.
If you want a broader overview first, read what OpenClaw is and how it works. If you just installed OpenClaw and want a general sanity check, your first message to OpenClaw covers the basic end-to-end idea.
What you need before you start
- A OpenClaw install that can run the Gateway
- Access to your OpenClaw config file on the server
- A Telegram account to talk to BotFather
If you are onboarding on a VPS over SSH and want to keep the web UI private, use the LumaDock KB guide for secure SSH port forwarding: OpenClaw quickstart onboarding over SSH.
Step 1: Create a Telegram bot with BotFather
Open Telegram and search for @BotFather. Start the chat and send:
/newbot
BotFather asks for two things:
- Bot name which is the display name people see
- Username which must be unique and must end in bot (example: my_openclaw_helper_bot)
When you finish, BotFather gives you a bot token. It looks like a long string with a colon in the middle.
Do not paste that token into chat rooms and do not commit it to Git. Anyone with it can impersonate your bot. Telegram’s own tutorial describes the token step in the official docs: From BotFather to “Hello World”.
Step 2: Add the token to OpenClaw config
On your server, open your OpenClaw config file and add Telegram under channels.
Example:
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "PASTE_YOUR_TOKEN_HERE",
"dmPolicy": "pairing"
}
}
}
dmPolicy pairing is a good default. It means random people who discover your bot username do not get full access.
After saving config, restart your OpenClaw Gateway if it’s already running.
Step 3: Start the Gateway and confirm it’s listening
Start the Gateway in a terminal session:
openclaw gateway --port 18789 --verbose
If you are hosting on a VPS, do not expose port 18789 publicly. Keep it bound to localhost and use SSH port forwarding or a private tunnel. Your security baseline is covered here: how to host OpenClaw securely on a VPS.
Step 4: Send /start then approve pairing
In Telegram, search for your bot username, open the chat, and send:
/start
If pairing is enabled, OpenClaw replies with a pairing code. Approve it on your server:
openclaw pairing approve telegram YOUR_CODE_HERE
Now send your first real message:
Hello
You should get a reply in a few seconds.
What just happened
Telegram routes your message to your bot identity based on the token you got from BotFather. OpenClaw listens for those updates through the Gateway, calls your model provider, then replies back through Telegram.
If you also want Telegram as part of a multi-channel setup (WhatsApp, Discord, Slack), read OpenClaw multi-channel setup.
Common problems and quick fixes
Bot does not reply to /start
- Confirm the Gateway is running
- Confirm the token was pasted correctly
- Check logs for errors then retry /start
Token is invalid
- Copy the token again directly from BotFather
- If you leaked it, revoke it immediately and generate a new one
Pairing code expired
- Send /start again to generate a new code then approve it quickly
Bot replies but feels “dumb” or slow
- That is often model choice. Use Claude vs OpenAI model choice for OpenClaw to pick a better default.
