> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://helpdesk.gbnetwork.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to Integrate Telegram with OpenClaw

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](https://helpdesk.gbnetwork.com/en/article/openclaw-vps-quick-start-guide-21trmo/).

### Steps to Obtain Your Token and Pairing Code

1. Open Telegram and search for [@BotFather](https://t.me/botfather/).
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/botfather_lfgst1.png =489xauto)

2. Send the command `/newbot` to start creating a new bot.
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/create-bot_2y3jb8.png =497x250)

3. Choose a **name** for your bot (e.g., `My AI Assistant`).
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/name-bot_14yhedb.png =497x76)

4. Choose a **username** for your bot. **Important:** The username must end with the word `bot` (e.g., `MyAIAssistantBot`, `my_ai_assistance_bot`).
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/username-bot_1cr7rmj.png =497x79)

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.
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/token-telegram-highlight_o0ujj7.png =497xauto)

---

### 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.
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/opt1-token_hiv38u.png =497x303)

3. Open Telegram and go to your bot's chat (using the link from BotFather).
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/bot-chat_13081z0.png =497x343)

4. Send `/start` to receive your Pairing Code.
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/start-bot-chat-v1_1depa4.png =497x308)

5. Enter the pairing code when asked, and the integration will complete.
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/pairing-code-1_bunjg7.png =497x386)
6. You should see a success message confirming the integration.
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/success-integrate_1uz9ny1.png =497x243)

---

### 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).
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/bot-chat_ahv8zg.png =497x343)

2. Send `/start` to receive your Chat ID and Pairing Code
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/start-bot-chat-v2_1x45uae.png =497x308)

3. Run the pairing command into your VPS.
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/pairing-code-2_ryn1y.png =497x62)

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 face any issues or need assistance, don’t hesitate to reach out — **our support team is always ready to help!**

🔧 **Need help?** [**Submit a Support Ticket**](https://secure.gbnetwork.com/submitticket.php)
💬 **Chat with us on Live Chat via our** [**website**](https://www.gbnetwork.my/)