Overview
The Telegram integration is sandbox-native — your bot token is stored securely inside your isolated sandbox environment and never leaves it. You create a bot through Telegram’s BotFather and provide the token to Coral.Prerequisites
- A Coral account with an active sandbox
- A Telegram account
Step 1: Create a Bot with BotFather
- Open Telegram and search for @BotFather, or click the link to open it directly.
- Send the
/newbotcommand. - Follow the prompts:
- Enter a display name for your bot (e.g., “My AI Assistant”).
- Enter a username for your bot. It must end in
bot(e.g.,my_coral_assistant_bot).
- BotFather will reply with your bot token. It looks like
123456789:ABCdefGHIjklMNOpqrSTUvwxYZ. Copy it.
Step 2: Configure Privacy Settings (Optional)
By default, Telegram bots can only see messages that directly mention them or are replies to their messages in group chats. If you want your bot to see all messages in a group:- Open a chat with @BotFather.
- Send
/setprivacy. - Select your bot.
- Choose “Disable” to allow the bot to read all group messages.
This is only needed for group chats. In direct messages, the bot always sees all messages.
Step 3: Connect in Coral
- Open the Coral dashboard and go to the Integrations page.
- Click on the Telegram card.
- Paste your bot token into the Bot Token field.
- Click “Connect”.
/getMe), then applies the configuration to your sandbox.
Step 4: Pair Your Telegram Account
After the bot connects, you need to pair your Telegram account:- Open Telegram and search for your bot by its username (e.g.,
@my_coral_assistant_bot). - Send it any message (e.g., “Hello”).
- The bot will reply with an 8-character pairing code (e.g.,
KVM9A75Y). - Go back to the Coral Integrations page and paste the code into the Pairing Code field.
- Click “Approve”.
You can skip pairing and do it later, but the bot will not respond to your messages until pairing is completed.
Managing Your Telegram Integration
Once connected, the Telegram card on the Integrations page shows your bot’s status:- Connected — The bot is online and responsive.
- Configured but not connected — The token is saved but the bot cannot connect. Click “Reconfigure” to enter a new token.
Troubleshooting
| Problem | Solution |
|---|---|
| Bot shows “configured but not connected” | Your token may have been revoked. Use /revoke with BotFather to generate a new token and reconfigure. |
| Bot doesn’t respond in group chats | Make sure you disabled privacy mode via /setprivacy with BotFather. |
| Bot doesn’t respond to DMs | Ensure pairing is completed. Also verify the token is correct. |
| ”Invalid bot token” error | Ensure you copied the full token from BotFather. The format is 123456789:ABCdefGHIjklMNOpqrSTUvwxYZ. |
Security
- Your bot token is stored exclusively inside your sandbox’s configuration file (
~/.openclaw/openclaw.json). - The token never passes through Coral’s servers — it is sent directly from the Coral UI to your sandbox via an authenticated gateway RPC.
- If you back up and restore your sandbox, the Telegram configuration is preserved in the backup.