Overview
Deploy an AI-powered Telegram bot using OpenClaw and AihubMax. This integration allows you to chat with AI models directly in Telegram conversations.This guide assumes you have already completed the basic OpenClaw Manual Installation. If not, please set up OpenClaw first.
Prerequisites
AihubMax API Key
An active AihubMax API key.
OpenClaw Instance
A running OpenClaw instance (see Manual Installation).
Telegram Account
A Telegram account to create a bot via BotFather.
Configuration
1
Create a Telegram Bot
- Open Telegram and visit @BotFather.
- Send
/start, then/newbot. - Set a username for your bot (must end with
bot, e.g.,my_foxapi_bot). - BotFather will provide a Bot Token — save it for the next step.
2
Run Onboarding with Telegram Channel
If you haven’t already onboarded OpenClaw, run the onboarding wizard and select Telegram as your channel:When prompted, select “Telegram (Bot API)” and paste your Bot Token.If you have already onboarded, you can manually add the Telegram configuration to
~/.openclaw/openclaw.json:3
Pair Your Telegram Account
After configuring the Telegram channel, you need to pair your Telegram account. Start a conversation with your bot in Telegram and you’ll receive a pairing code.Then run:
4
Test Your Bot
- Open Telegram and search for your bot by its username.
- Send a test message like “Hello!”
- The bot should respond using the configured AI model through AihubMax.
In group chats, the bot requires an
@mention by default. You can change this behavior in the groups configuration.Bot Usage
Verify the Connection
Send a message to your Telegram bot:Troubleshooting
Bot does not respond to messages
Bot does not respond to messages
- Check that the bot token in
openclaw.jsonis correct. - Verify the OpenClaw daemon is running:
openclaw status - Ensure your AihubMax API key is valid and has balance.
- Check logs for errors.
Pairing code not received
Pairing code not received
- Make sure the Telegram channel is enabled in
openclaw.json. - Restart the OpenClaw daemon after config changes.
- Try sending
/startto the bot first.
Bot works in DM but not in groups
Bot works in DM but not in groups
- In groups, the bot requires
@mentionby default. - You can set
"requireMention": falsein the groups config to allow free-form responses. - Make sure the bot has been added to the group as a member.