An OpenClaw skill for sending local files, images, audio, video, and other media through QQBot.
This skill stages local files into the QQBot media relay directory, sends them with <qqmedia>...</qqmedia>, and then cleans up only the temporary staged copy after the send attempt finishes.
- Send local files through QQBot using
<qqmedia>...</qqmedia> - Automatically stage local files into the QQBot media relay directory
- Clean up only the staged temporary copy after sending
- Protect original source files from accidental deletion
- Normalize staged file extensions to lowercase
- Detect occupied, locked, or inaccessible files
- Enforce a 10 MB file size limit
- Support HTTP(S) media URLs without staging or cleanup
.
├── README.md
├── SKILL.md
└── scripts
└── stage_media.py
The OpenClaw skill definition file.
It tells OpenClaw how to handle QQBot file sending requests, including when to stage local files, how to send them with <qqmedia>...</qqmedia>, and when to clean up the temporary staged copy.
The local media staging and cleanup helper script.
It supports two operations:
- Stage a source file into the QQBot media relay directory.
- Clean up a staged file after the send attempt finishes.
python scripts/stage_media.py <source_path>Example:
python scripts/stage_media.py "C:\Users\name\Desktop\example.txt"The script copies the file into:
~/.openclaw/media/qqbot/
Then it prints the staged absolute path, for example:
C:\Users\name\.openclaw\media\qqbot\abc123.txt
Use the returned path for QQBot media sending:
<qqmedia>C:\Users\name\.openclaw\media\qqbot\abc123.txt</qqmedia>
After the QQBot send attempt finishes, clean up the staged file with:
python scripts/stage_media.py --cleanup <staged_path>Example:
python scripts/stage_media.py --cleanup "C:\Users\name\.openclaw\media\qqbot\abc123.txt"Only pass the staged path to --cleanup.
Never pass the original source file path to --cleanup.
This project is designed to avoid accidental deletion of user files.
The cleanup command must only be used with the exact staged path returned by the staging command.
Do not clean up:
- the original source file
- a user-provided path that was not returned by the staging script
- an HTTP(S) URL
- a guessed path
- any arbitrary file under
~/.openclaw/media/qqbot/
The original source file is copied, not modified.
For local files:
source file
↓
stage_media.py <source_path>
↓
temporary staged copy under ~/.openclaw/media/qqbot/
↓
send with <qqmedia>staged-path</qqmedia>
↓
stage_media.py --cleanup <staged-path>
For HTTP(S) URLs:
URL
↓
send directly with <qqmedia>URL</qqmedia>
↓
no staging
↓
no cleanup
The default file size limit is 10 MB.
Files larger than this limit will not be staged.
- This skill does not delete the original file.
- Cleanup must be performed through
stage_media.py --cleanup. - QQBot plugin code should not directly delete staged files with
unlink,rm,del,fs.unlink, or similar methods. - If sending fails after staging succeeds, cleanup should still be attempted.
- If cleanup fails, report the cleanup failure and do not manually delete another path.
MIT License