Skip to content

Connect OpenClaw to Telegram

Integrating OpenClaw with Telegram provides a lightweight, highly responsive mobile interface for your local AI. To do this, we will use Telegram’s official “BotFather” to generate a unique bot and access token.

In Telegram, all custom bots are created by talking to a central, verified bot named BotFather.

  1. Open your Telegram app (mobile or desktop).
  2. In the search bar at the top, type @BotFather and select the verified account (it will have a blue checkmark).
  3. Click Start at the bottom of the chat to initiate the conversation.
  4. Send the command: /newbot
  5. Name your bot: BotFather will ask for a display name (e.g., TechBitNow Agent). Type it and hit send.
  6. Choose a username: Next, BotFather needs a unique system username. It must end in the word “bot” (e.g., TechBitNow_LLM_bot).
  7. Once accepted, BotFather will reply with a long congratulatory message containing your HTTP API Token.

⚠️ Important: Copy this long string of text (it looks something like 123456789:ABCdefGhIJKlmNoPQRsTuvWxyz). Keep it secure; anyone with this token can control your bot.

Step 2: Get Your Personal Telegram User ID

Section titled “Step 2: Get Your Personal Telegram User ID”

Just like Discord, OpenClaw likely needs to know who you are so it only responds to you and not random strangers on the internet.

To find your unique Telegram User ID:

  1. Go back to the main Telegram search bar.
  2. Search for @userinfobot (or @RawDataBot).
  3. Click Start to interact with it.
  4. The bot will instantly reply with a block of text containing your profile information.
  5. Look for the line that says Id: (e.g., Id: 987654321).
  6. Copy this number and save it next to your Bot Token.

With your API token secured, we need to feed it into the OpenClaw system to establish the initial bridge.

  1. Open your OpenClaw interface (you can use either the web dashboard or your active Ubuntu terminal session).
  2. Navigate to the chat prompt or your OpenClaw configuration file.
  3. Send or paste the HTTP API token you received from BotFather. OpenClaw will register the bot and wait for your user authentication.

Now that OpenClaw is linked to the bot, you must prove you are the authorized user to prevent unauthorized access to your local LLM.

  1. Go back to Telegram and click the direct t.me link provided by BotFather. This will open a direct chat window with your newly created bot.
  2. Click Start at the bottom of the chat.
  3. The bot will automatically respond with two critical pieces of information: your Telegram User ID and a unique Pairing Code.
  4. Copy this entire message.
  5. Head back to your OpenClaw interface and paste the User ID and Pairing Code directly into the chat to authorize the connection.
  6. OpenClaw will process the code and confirm the pairing is successful.

Test the Connection: To verify everything is routed correctly, open your Telegram bot on your phone or desktop and send a test message: "Hey, are you online?"

Your local OpenClaw LLM will process the prompt on your Ubuntu VM and reply directly to your Telegram app!