Install
openclaw skills install telegram-file-senderSend files or notes up to 50MB to a Telegram user via bot, supporting local, iCloud, relative, or Knowledge/ paths with automatic zipping if needed.
openclaw skills install telegram-file-senderSend files to a Telegram user via bot, handling workspace path restrictions and Telegram's 50MB file size limit.
This skill enables an AI agent to send files from the local filesystem (including iCloud Drive paths) to a Telegram user through a bot account. It handles:
The agent must have:
If any of these are missing, ask the user before proceeding.
If the user didn't specify a path, ask them.
Accepted formats:
/Users/you/Documents/file.any~ expansion: ~/path/to/file.md, .txt, .pdf, .zip, images, etc.)python3 skills/telegram-send-file/scripts/send_file.py "<source_path>" "<target_user_id>" [caption] [accountId]
Arguments:
| Arg | Required | Default | Description |
|---|---|---|---|
source_path | Yes | — | Absolute path to the file |
target_user_id | Yes | — | Telegram chat ID (e.g. 123456789) |
caption | No | "" | Text caption shown before the file |
accountId | No | (first bot) | Bot accountId configured in OpenClaw |
The script outputs key-value lines on stdout:
SEND_PATH=/tmp/xyz/file.md
SEND_FILENAME=file.md
TARGET=123456789
CAPTION=📄 My Document
ACCOUNT_ID=your_bot_account
READY
Extract SEND_PATH, TARGET, ACCOUNT_ID from the output.
{
"action": "send",
"channel": "telegram",
"target": "<TARGET from output>",
"accountId": "<ACCOUNT_ID from output>",
"filePath": "<SEND_PATH from output>",
"asDocument": true
}
Use filePath (absolute path), not path or relative paths.
After message tool returns ok: true, delete the temp file:
rm <SEND_PATH>
rm -rf <parent_tmp_dir>
| File size | Behavior |
|---|---|
| ≤ 50MB | Copied to tmp, sent as-is |
| > 50MB | Auto-zipped; sent if result ≤ 50MB |
| > 50MB after zip | Prints FAIL + suggestion; does not send |
The suggestion will be either:
python3 skills/telegram-send-file/scripts/send_file.py \
"/Users/you/Documents/report.pdf" \
"123456789" \
"📄 Report" \
"your_bot_account"
Works with any extension: .md, .txt, .pdf, .zip, .png, .jpg, .json, etc.
If a file exceeds 50MB, the script auto-zips it. If the zip is ≤ 50MB, it sends the zip automatically.
python3 skills/telegram-send-file/scripts/send_file.py \
"/Users/you/path/to/file.png" \
"123456789" \
"🖼 Image" \
"another_bot_account"
The script exits with FAIL: Source file not found. Ask the user to verify the path.
If the file exists but cannot be read, the script will fail. Check file permissions.
Allowed. The script sends it normally.
Allowed. The script handles any file type, not just text.
Telegram handles filenames up to 255 chars. The script preserves the original basename.
zipfile module only)If sending fails:
ls -lh <path>ls <path>cp <path> /tmp/accountId is correct in OpenClaw configThis skill wraps the message tool's send action with file-document support. The workflow is:
message tool with the prepared absolute pathThe skill exists because: