Skip to content

ZJunCher/openclaw-qqbot-send-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenClaw QQBot Send Skill

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.

Features

  • 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

Repository Structure

.
├── README.md
├── SKILL.md
└── scripts
    └── stage_media.py

Files

SKILL.md

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.

scripts/stage_media.py

The local media staging and cleanup helper script.

It supports two operations:

  1. Stage a source file into the QQBot media relay directory.
  2. Clean up a staged file after the send attempt finishes.

Usage

Stage a local file

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>

Clean up a staged file

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.

Safety Rules

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.

Recommended Send Flow

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

File Size Limit

The default file size limit is 10 MB.

Files larger than this limit will not be staged.

Notes

  • 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.

License

MIT License

About

OpenClaw QQBot skill for sending local files, images, audio, video, and other media with safe temporary staging and cleanup.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages