Telegram Send File
Use this skill for file delivery to Telegram, not for ordinary chat messages.
Scope
- - Send a local file to Telegram
- Send a file by URL or existing Telegram INLINECODE0
- Reuse the current OpenClaw Telegram session context when available
- Send one file or a batch of files into a chat/topic
Do not use this skill for
- - Normal assistant replies in the current chat
- Cross-session messaging between OpenClaw sessions
- Rich Telegram bot workflows beyond file delivery
Core commands
CODEBLOCK0
Workflow
- 1. If running inside an OpenClaw Telegram session, try auto-detected
chat_id and topic_id first. - If auto-detection is unavailable, pass
--chat-id and optionally --topic-id. - For local files, let the script choose the Telegram method from file extension.
- For URL and
file_id sends, default to document delivery unless you intentionally extend the script. - Use batch mode for sequential delivery when multiple files should go to the same destination.
Notes
- - Auto-detection is best-effort, not guaranteed in every runtime context.
- Local-file type detection is more precise than URL /
file_id sending. - For Telegram Bot API details and limits, see
references/api_reference.md.
Telegram 发送文件
使用此技能进行文件投递到 Telegram,不适用于普通聊天消息。
适用范围
- - 将本地文件发送到 Telegram
- 通过 URL 或现有 Telegram file_id 发送文件
- 尽可能复用当前 OpenClaw Telegram 会话上下文
- 向聊天/话题发送单个文件或批量文件
请勿使用此技能处理
- - 当前聊天中的普通助手回复
- OpenClaw 会话之间的跨会话消息传递
- 除文件投递外的复杂 Telegram 机器人工作流
核心命令
bash
尽可能使用当前 OpenClaw Telegram 上下文
python3 scripts/telegram
sendfile.py --file document.pdf
显式指定目标
python3 scripts/telegram
sendfile.py --chat-id -1001234567890 --topic-id 3 --file screenshot.png
批量模式(保留话题/线程)
python3 scripts/telegram
sendfile.py --files a.pdf b.png --caption 批量投递
通过 URL 或已有的 Telegram file_id 发送
python3 scripts/telegram
sendfile.py --url https://example.com/report.pdf
python3 scripts/telegram
sendfile.py --file-id AQAD...
工作流程
- 1. 如果在 OpenClaw Telegram 会话中运行,优先尝试自动检测 chatid 和 topicid。
- 如果自动检测不可用,则传入 --chat-id 和可选的 --topic-id。
- 对于本地文件,让脚本根据文件扩展名选择 Telegram 方法。
- 对于 URL 和 file_id 发送,默认以文档形式投递,除非你有意扩展脚本。
- 当多个文件需要发送到同一目标时,使用批量模式进行顺序投递。
注意事项
- - 自动检测为尽力而为,不保证在所有运行时上下文中可用。
- 本地文件类型检测比 URL / fileid 发送更精确。
- 有关 Telegram Bot API 的详细信息和限制,请参阅 references/apireference.md。