Skip to main content

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

  1. Open Telegram and visit @BotFather.
  2. Send /start, then /newbot.
  3. Set a username for your bot (must end with bot, e.g., my_foxapi_bot).
  4. 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

  1. Open Telegram and search for your bot by its username.
  2. Send a test message like “Hello!”
  3. 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:
The bot should reply with a response generated by the AI model configured through AihubMax.

Troubleshooting

  • Check that the bot token in openclaw.json is correct.
  • Verify the OpenClaw daemon is running: openclaw status
  • Ensure your AihubMax API key is valid and has balance.
  • Check logs for errors.
  • Make sure the Telegram channel is enabled in openclaw.json.
  • Restart the OpenClaw daemon after config changes.
  • Try sending /start to the bot first.
  • In groups, the bot requires @mention by default.
  • You can set "requireMention": false in the groups config to allow free-form responses.
  • Make sure the bot has been added to the group as a member.