This guide will walk you through connecting your Telegram bot to your OpenClaw AI agent. Once integrated, you can interact with your AI directly from Telegram.

Prerequisites

Before you begin, ensure you have:

  • An active OpenClaw VPS
  • SSH access to your VPS
  • A Telegram account

If you're new to OpenClaw, feel free to check out this guideline.

Steps to Obtain Your Token and Pairing Code

  1. Open Telegram and search for @BotFather.
    Telegram BotFather

  2. Send the command /newbot to start creating a new bot.
    Screenshot for How to Integrate Telegram with OpenClaw

  3. Choose a name for your bot (e.g., My AI Assistant).
    Screenshot for How to Integrate Telegram with OpenClaw

  4. Choose a username for your bot. Important: The username must end with the word bot (e.g., MyAIAssistantBot, my_ai_assistance_bot).
    Screenshot for How to Integrate Telegram with OpenClaw

  5. Once created, BotFather will send you a message with your bot's token and a link to chat with your bot (e.g., t.me/MyAIAssistantBot). Save your bot token securely. You'll need it in the next step.
    Location of the Telegram bot token


Option 1: If You Did Not Add a Token During Purchase

If you didn't provide a Telegram bot token during purchase, you'll need to create a bot and configure it manually using the setup-telegram command.

  1. Run setup command: setup-telegram.

  2. When prompted, paste your bot token and press Enter.
    Screenshot for How to Integrate Telegram with OpenClaw

  3. Open Telegram and go to your bot's chat (using the link from BotFather).
    Screenshot for How to Integrate Telegram with OpenClaw

  4. Send /start to receive your Pairing Code.
    Screenshot for How to Integrate Telegram with OpenClaw

  5. Enter the pairing code when asked, and the integration will complete.
    Screenshot for How to Integrate Telegram with OpenClaw

  6. You should see a success message confirming the integration.
    Screenshot for How to Integrate Telegram with OpenClaw


Option 2: If You Added Your Bot Token During Purchase

If you provided your Telegram bot token at the time of purchase, your bot is already partially configured. Follow these steps to complete the pairing:

  1. Open Telegram and go to your bot's chat (using the link from BotFather).
    Screenshot for How to Integrate Telegram with OpenClaw

  2. Send /start to receive your Chat ID and Pairing Code
    Screenshot for How to Integrate Telegram with OpenClaw

  3. Run the pairing command into your VPS.
    Screenshot for How to Integrate Telegram with OpenClaw

  4. You have successfully integrated Telegram with OpenClaw.


Verification

To confirm your Telegram integration is working:

  1. Wait about 30 seconds after the service restarts.
  2. Send a message to your bot in Telegram.
  3. Your AI agent should reply within a few seconds.

If you don't receive a response, check the logs using command: openclaw-logs.

Important Notes

After successfully integrating Telegram, your OpenClaw service will automatically restart. This is normal.

You will be logged out of your OpenClaw web dashboard. To regain access, you will need to re-enter your gateway token.

Security Reminder

  • Keep your bot token and pairing codes confidential.
  • If you suspect your token is compromised, you can generate a new one via BotFather and repeat the setup process.

Need Further Assistance?

If you need help with this guide, our support team is ready to assist you.

?האם התשובה שקיבלתם הייתה מועילה 0 משתמשים שמצאו מאמר זה מועיל (0 הצבעות)