Convert local files into Telegram-friendly downloadable attachments.
MEDIA: delivery of .md or raw text failed (user couldn't download)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# 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
In your reply, add:
MEDIA:/tmp/output.pdf
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.
~/.local/bin/mdpdf -o /tmp/report.pdf /home/axiom/.openclaw/workspace/report.md
Reply:
MEDIA:/tmp/report.pdf
~/.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
Just send directly — no conversion needed:
MEDIA:/path/to/file.pdf
# Wrap in a zip for reliable download
cd /tmp && zip data.zip data.csv
Reply:
MEDIA:/tmp/data.zip
The MEDIA:/path line in assistant output triggers OpenClaw's file delivery:
/tmp, ~/.openclaw/media/sendDocument)MEDIA: lines = multiple attachmentspip install mdpdf)共 1 个版本