当前位置: 首页 > Skill >

Telegram

Telegram

0.2.2 2026.11.21 浏览:537
获取Skill文件查看使用说明
作者:陈舟许可证:
本文目录展开

Telegram

Send messages, manage chats, handle files, and automate Telegram bot workflows via the Telegram Bot API.

This skill uses ClawLink 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.

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

# 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

clawlink_list_integrations

Response: Returns all connected integrations. Look for telegram in the list.

Verify Connection

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

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
  }'

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:
    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:
    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
  • Telegram Bot Features
  • 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 — an integration hub for OpenClaw

ClawLink Logo

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,051
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,039
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,027
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,026
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,024
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,021
Skill 文件
  • SKILL.md
    • Telegram
      • Setup in 3 Steps
    • How It Works
    • Install
    • Quick Start
    • Authentication
      • Getting Connected
    • Connection Management
      • List Connections
      • Verify Connection
      • Reconnect
    • Security & Permissions
    • Tool Reference
      • Bot Info
      • Messages
      • Chats
      • Callbacks
      • Bot Commands
    • Code Examples
      • Send a text message
      • Send a photo
      • Send a poll
      • Get chat information
      • Get chat member info
      • Forward a message
    • Discovery Workflow
    • Execution Workflow
    • Notes
    • Error Handling
      • Troubleshooting: Tools Not Visible
      • Troubleshooting: Message Send Fails
      • Troubleshooting: Delete Message Fails
    • Resources
  • 项目或源文件

相关 Skill

更多
Openclaw Network Diagnostics Openclaw Network Diagnostics OpenClaw独立高级网络诊断工具,持续测试从OpenClaw代理到Telegram Bot API的端到端连接性并估算延迟。
Telegram .md File Uploader Telegram .md File Uploader 将OpenClaw工作区中的.md文件上传并发送到指定的Telegram聊天,使用Telegram Bot API。当你需要分享工作区文件时使用。
Telegram Bot API Telegram Bot API 使用正确的 API 调用、消息格式、键盘和 webhook 配置构建 Telegram 机器人。
Telegram 消息 LITE Telegram 消息 LITE Telegram Bot API 基础消息发送与聊天信息查询。
Lovefromio Telegram Lovefromio Telegram OpenClaw技能,使用直接HTTPS请求(无需SDK)设计Telegram Bot API工作流和命令驱动的对话。