Send messages, manage chats, handle files, and automate Telegram bot workflows via the Telegram Bot API. Use this skill when users want to send messages, man...
---
name: telegram-messaging
description: Send messages, manage chats, handle files, and automate Telegram bot workflows via the Telegram Bot API. Use this skill when users want to send messages, manage groups, handle media, or automate notifications via Telegram.
---
# Telegram

Send messages, manage chats, handle files, and automate Telegram bot workflows via the Telegram Bot API.
This skill uses [ClawLink](https://claw-link.dev/?utm_source=clawhub&utm_medium=referral&utm_content=telegram-messaging) for hosted connection flows and credentials so you do not need to configure Telegram API access yourself.
### Setup in 3 Steps
| Step 1: Install | Step 2: Pair Account | Step 3: Connect Telegram |
|:---:|:---:|:---:|
|  |  | *App-specific connection GIF coming soon* |
| Run the install command in OpenClaw | Sign in and approve the device | Open the dashboard and connect Telegram |
## How It Works
```
┌─────────────────┐ ┌──────────────┐ ┌──────────────────┐
│ OpenClaw │────▶│ ClawLink │────▶│ Telegram Bot │
│ (User Chat) │ │ (OAuth) │ │ API │
└─────────────────┘ └──────────────┘ └──────────────────┘
│ │ │
│ 1. Install Plugin │ │
│ 2. Pair Device │ │
│ 3. Connect Telegram │ │
│ │ 4. Secure Token │
│ │ 5. Proxy Requests │
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ SKILL │ │ Dashboard│ │ Telegram │
│ File │ │ Auth │ │ Bot │
└──────────┘ └──────────┘ └──────────┘
```
## Install
Install the verified ClawLink plugin from ClawHub. After the user confirms, complete the full setup so ClawLink tools are visible in the next OpenClaw chat.
```bash
openclaw plugins install clawhub:clawlink-plugin
openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
openclaw gateway restart
```
Then tell the user: "OpenClaw has been restarted. Send `/new` as a standalone message to start a fresh chat, then ask for Telegram again."
## Quick Start
```bash
# Get bot info
clawlink_call_tool --tool "telegram_get_me" --params '{}'
# Get chat info
clawlink_call_tool --tool "telegram_get_chat" --params '{"chat_id": "CHAT_ID"}'
# Send a message
clawlink_call_tool --tool "telegram_send_message" --params '{"chat_id": "CHAT_ID", "text": "Hello from OpenClaw!"}'
```
## Authentication
All Telegram tool calls are authenticated automatically by ClawLink using the bot token from the user's connected Telegram bot.
**No bot token is required in chat.** ClawLink stores the bot token securely and injects it into every Telegram Bot API request on the user's behalf.
### Getting Connected
1. Install the ClawLink plugin (see Install above).
2. Pair the plugin with `clawlink_begin_pairing` if it is not configured yet.
3. Open https://claw-link.dev/dashboard?add=telegram and connect Telegram.
4. Call `clawlink_list_integrations` to verify the connection is active.
## Connection Management
### List Connections
```bash
clawlink_list_integrations
```
**Response:** Returns all connected integrations. Look for `telegram` in the list.
### Verify Connection
```bash
clawlink_list_tools --integration telegram
```
**Response:** Returns the live tool catalog for Telegram.
### Reconnect
If Telegram tools are missing or the connection shows an error:
1. Direct the user to https://claw-link.dev/dashboard?add=telegram
2. After they confirm, call `clawlink_list_integrations` to verify
3. Then call `clawlink_list_tools --integration telegram`
## Security & Permissions
- Access is scoped to the Telegram bot token connected during setup.
- **All write operations (send message, delete message, kick user) require explicit user confirmation.**
- Messages can only be sent to chats where the bot is a member with posting rights.
- The bot must have admin rights in groups/channels to perform moderation actions.
- Rate limits apply (~30 messages/second globally, ~1 message/second per chat).
## Tool Reference
### Bot Info
| Tool | Description | Mode |
|------|-------------|------|
| `telegram_get_me` | Get basic bot information (username, name, capabilities) | Read |
| `telegram_get_updates` | Receive incoming updates via long polling | Read |
### Messages
| Tool | Description | Mode |
|------|-------------|------|
| `telegram_send_message` | Send a text message to a chat | Write |
| `telegram_send_photo` | Send a photo to a chat | Write |
| `telegram_send_document` | Send a document/file to a chat | Write |
| `telegram_send_location` | Send a location point on a map | Write |
| `telegram_send_poll` | Send a native poll to a chat | Write |
| `telegram_edit_message` | Edit an existing bot-sent message | Write |
| `telegram_delete_message` | Delete a bot-sent or service message | Write |
| `telegram_forward_message` | Forward a message to another chat | Write |
### Chats
| Tool | Description | Mode |
|------|-------------|------|
| `telegram_get_chat` | Get chat information by ID | Read |
| `telegram_get_chat_history` | Get messages from a chat | Read |
| `telegram_get_chat_member` | Get a user's status/role in a chat | Read |
| `telegram_get_chat_administrators` | List admins in a chat | Read |
| `telegram_get_chat_members_count` | Get member count for a chat | Read |
| `telegram_create_chat_invite_link` | Generate a new primary invite link | Write |
| `telegram_revoke_chat_invite_link` | Revoke an existing invite link | Write |
### Callbacks
| Tool | Description | Mode |
|------|-------------|------|
| `telegram_answer_callback_query` | Send an answer to a callback query from inline keyboard | Write |
### Bot Commands
| Tool | Description | Mode |
|------|-------------|------|
| `telegram_set_my_commands` | Set the bot's command list | Write |
| `telegram_get_my_commands` | Get the bot's current command list | Read |
## Code Examples
### Send a text message
```bash
clawlink_call_tool --tool "telegram_send_message" \
--params '{
"chat_id": "-1001234567890",
"text": "Deployment complete! Version 2.1.0 is live on production."
}'
```
### Send a photo
```bash
clawlink_call_tool --tool "telegram_send_photo" \
--params '{
"chat_id": "-1001234567890",
"photo": "https://example.com/chart.png",
"caption": "Weekly activity report"
}'
```
### Send a poll
```bash
clawlink_call_tool --tool "telegram_send_poll" \
--params '{
"chat_id": "-1001234567890",
"question": "Which feature should we prioritize next?",
"options": ["Dark mode", "Export to PDF", "Team sharing", "API access"]
}'
```
### Get chat information
```bash
clawlink_call_tool --tool "telegram_get_chat" \
--params '{
"chat_id": "-1001234567890"
}'
```
### Get chat member info
```bash
clawlink_call_tool --tool "telegram_get_chat_member" \
--params '{
"chat_id": "-1001234567890",
"user_id": "123456789"
}'
```
### Forward a message
```bash
clawlink_call_tool --tool "telegram_forward_message" \
--params '{
"chat_id": "-1009876543210",
"from_chat_id": "-1001234567890",
"message_id": 42
}'
```
## Discovery Workflow
1. Call `clawlink_list_integrations` to confirm Telegram is connected.
2. Call `clawlink_list_tools --integration telegram` to see the live catalog.
3. Treat the returned list as the source of truth. Do not guess or assume what tools exist.
4. If the user describes a capability but the exact tool is unclear, call `clawlink_search_tools` with a short query and integration `telegram`.
5. If no Telegram tools appear, direct the user to https://claw-link.dev/dashboard?add=telegram.
## Execution Workflow
```
┌─────────────────────────────────────────────────────────────┐
│ READ OPERATIONS (Safe) │
│ get → list → fetch → describe │
│ │
│ Example: Get chat info → Get chat history → Report │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ WRITE OPERATIONS (Require Confirmation) │
│ describe → preview → confirm → call │
│ │
│ Example: Preview message → User approves → Send message │
└─────────────────────────────────────────────────────────────┘
```
1. For unfamiliar tools, ambiguous requests, or any write action, call `clawlink_describe_tool` first.
2. Use the returned guidance, schema, `whenToUse`, `askBefore`, `safeDefaults`, `examples`, and `followups` to shape the call.
3. Prefer read and get operations before writes when that reduces ambiguity.
4. For writes or anything marked as requiring confirmation, call `clawlink_preview_tool` first.
5. Execute with `clawlink_call_tool`. Pass confirmation only after the preview matches the user's intent.
6. If the tool call fails, report the real error. Do not invent results or restate the failure as a missing capability unless the live catalog supports that conclusion.
## Notes
- Chat IDs for groups/channels start with `-100` (e.g., `-1001234567890`). User DMs use the user's numeric ID.
- Telegram Bot API uses Unix timestamps in UTC for message dates.
- `telegram_get_updates` and webhooks are mutually exclusive — if a webhook is active, polling returns a 409 Conflict.
- Rate limits: ~30 messages/second globally, ~1 message/second per chat. On HTTP 429, honor the `retry_after` value.
- The bot can only delete messages it sent itself or messages in groups where it has admin rights.
- Photos are re-encoded by Telegram; use `send_document` to preserve original quality.
- Messages older than 48 hours cannot be deleted in groups.
## Error Handling
| Status / Error | Meaning |
|----------------|---------|
| Tool not found | The tool name does not exist in the current catalog. Verify with `clawlink_list_tools --integration telegram`. |
| Missing connection | Telegram is not connected. Direct the user to https://claw-link.dev/dashboard?add=telegram. |
| `chat_not_found` | The chat ID does not exist or the bot is not a member. |
| `bot_not_member` | The bot is not a member of the target chat. |
| `message_not_found` | The message ID does not exist in the chat. |
| `user_not_found` | The user ID does not match any chat member. |
| `message_to_delete_not_found` | Cannot delete — message may be too old (48h+ in groups) or not bot-authored. |
| `not_enough_rights` | Bot lacks admin rights needed for this action in the group. |
| `retry_after` | Rate limited — honor the retry delay (seconds). |
| `invalid_token` | The bot token is invalid. Reconnect Telegram. |
| Write rejected | User did not confirm a write action. Always confirm before executing writes. |
### Troubleshooting: Tools Not Visible
1. Check that the ClawLink plugin is installed:
```bash
openclaw plugins list
```
2. If the plugin is installed but tools are missing, tell the user to send `/new` as a standalone message to reload the catalog.
3. If a fresh chat does not help, run:
```bash
openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
openclaw gateway restart
```
4. After restart, tell the user to send `/new` again and retry.
### Troubleshooting: Message Send Fails
1. Confirm the bot is a member of the target chat with post rights.
2. Check the chat ID format — groups use `-100` prefix, users use numeric ID.
3. Verify the bot has permission to send media if attaching photos/documents.
4. If `chat_not_found` appears, the bot may have been removed from the group.
### Troubleshooting: Delete Message Fails
1. The bot can only delete its own messages or messages in groups where it is an admin.
2. Messages older than 48 hours in groups cannot be deleted via the Bot API.
3. Service messages (user join/leave) cannot be deleted.
## Resources
- [Telegram Bot API Documentation](https://core.telegram.org/bots/api)
- [Telegram Bot Features](https://core.telegram.org/bots/features)
- [BotFather](https://t.me/botfather) — manage bot settings and commands
- ClawLink: https://claw-link.dev/?utm_source=clawhub&utm_medium=referral&utm_content=telegram-messaging
- ClawLink Docs: https://docs.claw-link.dev/openclaw
- ClawLink Verification: https://claw-link.dev/verify
---
**Powered by [ClawLink](https://claw-link.dev/?utm_source=clawhub&utm_medium=referral&utm_content=telegram-messaging)** — an integration hub for OpenClaw
don't have the plugin yet? install it then click "run inline in claude" again.
restructured original into implexa's 6-part format (intent, inputs, procedure with explicit in/out, decision points with if-else branches, output contract with json examples, outcome signal), added edge cases like rate limits 409 conflicts message age limits and service message restrictions, documented clawlink as external connection with setup guidance, preserved all original tools examples and error handling, removed marketing language and em-dashes throughout.
Send messages, manage chats, handle files, and automate Telegram bot workflows via the Telegram Bot API.
use this skill to send text and media messages, manage group memberships and permissions, retrieve chat history, and automate Telegram bot notifications and workflows. deploy it when you need to notify users across Telegram channels, moderate groups, poll audiences, or integrate Telegram into larger automation chains. the skill handles auth via ClawLink, a hosted oauth proxy that stores bot tokens securely and injects them into api calls on your behalf.
ClawLink Plugin & Pairing
clawlink_begin_pairing if not yet configuredTelegram Bot Setup
Runtime Context
-1001234567890 for groups/channels, numeric user ID for direct messages)External Connection
install clawlink plugin
openclaw plugins install clawhub:clawlink-plugin in your openclaw instanceopenclaw plugins listconfigure plugin allowlist
openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-jsonrestart gateway
openclaw gateway restartpair clawlink device (if not already paired)
clawlink_begin_pairingconnect telegram bot
verify telegram connection
clawlink_list_integrationstelegram is presentlist available telegram tools
clawlink_list_tools --integration telegramfor read operations (get, list, fetch)
clawlink_describe_tool --tool <tool_name> to understand schemaassemble read call parameters
telegram_get_chat)execute read operation
clawlink_call_tool --tool <tool_name> --params '<json>'for write operations (send, delete, edit, kick)
clawlink_describe_tool --tool <tool_name> firstaskBefore requirements, examplespreview write operation
clawlink_preview_tool --tool <tool_name> --params '<json>' to show user what will happenconfirm write with user
execute write operation (after confirmation)
clawlink_call_tool --tool <tool_name> --params '<json>' --confirm truehandle rate limits
retry_after header valuereload tools on fresh chat
/new as a standalone messageif clawlink plugin not installed
/new as a standalone message to start a fresh chat, then ask for telegram again."if telegram integration not connected
clawlink_list_integrationsif tool name is unfamiliar or user request is ambiguous
clawlink_describe_tool --tool <name> or clawlink_search_tools --query <term> --integration telegram to clarifyif operation is a write (send, delete, edit, forward, set commands, create/revoke link)
clawlink_preview_tool first, show user, wait for explicit confirmation before calling clawlink_call_toolclawlink_call_tool directly after assembling paramsif api call returns 409 conflict (webhook active)
if api call returns 400 chat_not_found or bot_not_member
-100 prefix), confirm bot is added to target chat with post rightsif api call returns 403 not_enough_rights
if api call returns 429 rate_limited
retry_after header, wait, then retryif api call returns invalid_token or missing connection
if attempting to delete message older than 48 hours in a group
if attempting to delete a service message (user join, leave, etc.)
if attempting to send photo and preserving original quality is critical
telegram_send_document instead of telegram_send_photo (telegram re-encodes photos)telegram_send_photo is fine for most use casesif tools are missing after plugin installation
openclaw plugins list, user sends /new, if still missing run config command from step 2 and restart gatewayfor read operations (get, list, fetch):
{"ok": true, "result": {"id": 123456789, "is_bot": true, "first_name": "MyBot", "username": "my_bot"}}{"ok": false, "error_code": 404, "description": "chat_not_found"}for write operations (send, delete, edit, create/revoke):
ok boolean and result field (on success) or error_code and description (on failure){"ok": true, "result": {"message_id": 42, "date": 1699564800, "chat": {...}, "text": "hello"}}{"ok": true, "result": true}{"ok": false, "error_code": 403, "description": "bot_not_member"}file location for tool catalog:
clawlink_list_tools --integration telegram, source of truthclawlink integration state:
clawlink_list_integrations returns object with integrations array, telegram entry present if connected{"integrations": ["telegram", "github", ...], "updated_at": "2024-01-15T10:30:00Z"}ok: true with result (message_id for sends, true for deletes), user sees confirmation "message sent to [chat_id]" or "message deleted"/new starts fresh chat, clawlink_list_tools --integration telegram returns non-empty catalogBot Info
telegram_get_me - get basic bot info (username, name, capabilities)telegram_get_updates - receive incoming updates via long pollingtelegram_set_my_commands - set the bot's command listtelegram_get_my_commands - get the bot's current command listMessages
telegram_send_message - send text message to a chattelegram_send_photo - send photo to a chattelegram_send_document - send document/file to a chattelegram_send_location - send location point on a maptelegram_send_poll - send native poll to a chattelegram_edit_message - edit an existing bot-sent messagetelegram_delete_message - delete a bot-sent or service messagetelegram_forward_message - forward a message to another chatChats
telegram_get_chat - get chat information by IDtelegram_get_chat_history - get messages from a chattelegram_get_chat_member - get a user's status/role in a chattelegram_get_chat_administrators - list admins in a chattelegram_get_chat_members_count - get member count for a chattelegram_create_chat_invite_link - generate a new primary invite linktelegram_revoke_chat_invite_link - revoke an existing invite linkCallbacks
telegram_answer_callback_query - send an answer to a callback query from inline keyboardsend a text message
clawlink_call_tool --tool "telegram_send_message" \
--params '{
"chat_id": "-1001234567890",
"text": "Deployment complete! Version 2.1.0 is live on production."
}'
send a photo
clawlink_call_tool --tool "telegram_send_photo" \
--params '{
"chat_id": "-1001234567890",
"photo": "https://example.com/chart.png",
"caption": "Weekly activity report"
}'
send a poll
clawlink_call_tool --tool "telegram_send_poll" \
--params '{
"chat_id": "-1001234567890",
"question": "Which feature should we prioritize next?",
"options": ["Dark mode", "Export to PDF", "Team sharing", "API access"]
}'
get chat information
clawlink_call_tool --tool "telegram_get_chat" \
--params '{
"chat_id": "-1001234567890"
}'
get chat member info
clawlink_call_tool --tool "telegram_get_chat_member" \
--params '{
"chat_id": "-1001234567890",
"user_id": "123456789"
}'
forward a message
clawlink_call_tool --tool "telegram_forward_message" \
--params '{
"chat_id": "-1009876543210",
"from_chat_id": "-1001234567890",
"message_id": 42
}'
| error | meaning | fix |
|---|---|---|
| tool_not_found | tool name does not exist in catalog | run clawlink_list_tools --integration telegram to verify |
| missing_connection | telegram not connected | go to https://claw-link.dev/dashboard?add=telegram and add bot token |
| chat_not_found | chat id invalid or bot not a member | confirm bot is added to chat with post rights |
| bot_not_member | bot is not a member of target chat | add bot to the group/channel first |
| message_not_found | message id does not exist | verify message_id is correct for the target chat |
| user_not_found | user id does not match any member | confirm user_id is a valid member of the chat |
| message_to_delete_not_found | cannot delete, may be too old or not bot-authored | messages 48h+ old in groups cannot be deleted; bot can only delete its own messages or messages in groups where it is admin |
| not_enough_rights | bot lacks admin rights in the group | make bot an admin to perform moderation actions |
| retry_after | rate limited | honor the retry_after header value (seconds) and retry |
| invalid_token | bot token invalid or expired | reconnect telegram via dashboard |
| write_rejected | user did not confirm action | always get explicit confirmation before executing writes |
-100 (e.g., -1001234567890), user dms use numeric user idtelegram_get_updates and webhooks are mutually exclusive (409 conflict if webhook is active)send_document to preserve original qualityPowered by ClawLink - an integration hub for OpenClaw. Source: clawhub.