How to Deploy a Telegram Bot with OpenClaw
Create an AI-powered Telegram bot with OpenClaw. Complete guide covering BotFather setup, token configuration, and advanced features like inline buttons.
This guide walks you through creating an AI-powered Telegram bot using OpenClaw. You'll create a bot via BotFather, configure it in OpenClaw, and enable advanced features like inline buttons and group support.
Step 1: Create a Bot with BotFather
Open Telegram and search for @BotFather
BotFather is Telegram's official bot for creating bots.
Send /newbot command
Start the bot creation flow.
Choose a name for your bot
This is the display name users will see (e.g., 'My AI Assistant').
Choose a username
Must be unique and end in 'bot' (e.g., 'myai_helper_bot').
Save your bot token
BotFather will give you a token like '123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11'. Keep this secret!
Step 2: Configure OpenClaw
Add your bot token to OpenClaw. You can use an environment variable or config file:
# Via environment variable
export TELEGRAM_BOT_TOKEN=your_token_hereOr in your ~/.openclaw/openclaw.json:
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "123456789:ABC-DEF1234...",
"dmPolicy": "pairing"
}
}
}Step 3: Configure Privacy Settings
For group support, configure privacy mode in BotFather. Send these commands to @BotFather:
/setprivacy → Select your bot → Disable
/setjoingroups → Select your bot → EnableStep 4: Enable Advanced Features
Inline Buttons
{
"channels": {
"telegram": {
"capabilities": {
"inlineButtons": "all"
}
}
}
}Custom Commands
{
"channels": {
"telegram": {
"customCommands": [
{ "command": "help", "description": "Show help message" },
{ "command": "status", "description": "Check bot status" }
]
}
}
}Group Configuration
{
"channels": {
"telegram": {
"groups": {
"*": { "requireMention": false }
}
}
}
}Step 5: Start and Test
Restart your gateway and test the bot:
# Restart gateway
openclaw gateway restart
# Check logs
openclaw logs --followSend a message to your bot on Telegram. If using pairing mode, approve the request:
openclaw pairing list telegram
openclaw pairing approve telegram <code>Deploy a Telegram bot instantly
No BotFather setup, no token management. Deploy an AI Telegram bot in 1 click.
Deploy Telegram Bot →