← 返回
未分类 中文

Axi Send File

Convert workspace files into Telegram-downloadable attachments (PDF/ZIP). Use when the user asks to receive, download, or be sent a file that was generated o...
将工作区文件转换为可在Telegram下载的附件(PDF/ZIP)。用于用户请求接收、下载或发送已生成的文件。
awalesagar
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 288
下载
💾 0
安装
1
版本
#latest

概述

send-file

Convert local files into Telegram-friendly downloadable attachments.

When to use

  • User says "send me the file", "download", "attach", "share this"
  • You generated a report, spreadsheet, or document the user wants
  • Previous MEDIA: delivery of .md or raw text failed (user couldn't download)

The Problem

OpenClaw's MEDIA: directive delivers files through Telegram's Bot API. However:

  • .md files → Telegram shows inline as plain text, NOT as a downloadable document
  • .zip files → Sometimes work, sometimes blocked
  • .pdf files → ✅ Always delivered as a downloadable document
  • .png/.jpg files → ✅ Always delivered as an image

Solution

Step 1: Convert to PDF

# Install if not already present
pip install --user --break-system-packages mdpdf 2>/dev/null

# Convert markdown → PDF
~/.local/bin/mdpdf -o /tmp/output.pdf /path/to/input.md

Step 2: Deliver via MEDIA

In your reply, add:

MEDIA:/tmp/output.pdf

For multiple files — ZIP them

cd /tmp && zip bundle.pdf.zip file1.pdf file2.pdf

Then:

MEDIA:/tmp/bundle.pdf.zip

Important: Name ZIP files with .pdf.zip suffix — Telegram handles these more reliably.

Delivery Patterns

Single markdown file

~/.local/bin/mdpdf -o /tmp/report.pdf /home/axiom/.openclaw/workspace/report.md

Reply:

MEDIA:/tmp/report.pdf

Multiple markdown files

~/.local/bin/mdpdf -o /tmp/report1.md file1.md
~/.local/bin/mdpdf -o /tmp/report2.md file2.md
cd /tmp && zip reports.pdf.zip report1.pdf report2.pdf

Reply:

MEDIA:/tmp/reports.pdf.zip

Already a binary file (PDF, image, etc.)

Just send directly — no conversion needed:

MEDIA:/path/to/file.pdf

Non-markdown text files (CSV, JSON, etc.)

# Wrap in a zip for reliable download
cd /tmp && zip data.zip data.csv

Reply:

MEDIA:/tmp/data.zip

OpenClaw MEDIA: Reference

The MEDIA:/path line in assistant output triggers OpenClaw's file delivery:

  • Local paths are resolved against allowed roots: workspace, /tmp, ~/.openclaw/media/
  • Files are loaded and sent via the channel's native API (Telegram Bot API sendDocument)
  • Must be on its own line, no other text on that line
  • Multiple MEDIA: lines = multiple attachments

Tool Dependencies

  • mdpdf — Markdown to PDF converter (pip install mdpdf)
  • zip — Standard Unix zip (usually pre-installed)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-08 01:43 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Copilot CLI

awalesagar
GitHub Copilot CLI 参考知识库。用于回答 Copilot CLI 功能、命令、配置、插件、钩子、技能、MC... 相关问题。
★ 1 📥 405

code-with-claude

awalesagar
全面的 Claude Code CLI 参考,涵盖交互模式、CLI 参数、命令、环境变量、钩子、通道、检查点、插件等。
★ 0 📥 405

Lean Context

awalesagar
通过上下文压缩、选择性加载等方式,降低AI代理系统(Claude Code、OpenClaw、GPT Codex、Cursor、Windsurf、Aider等)的token使用量。
★ 0 📥 297