#How can OpenClaw autonomously send images
1 messages · Page 1 of 1 (latest)
How can OpenClaw autonomously send images
If you mean “I tell the agent /path/to/img.png + a Discord channel:<id> and it posts it there”, there are two supported patterns:
1) Send media as part of an agent reply (same chat/thread)
Have the agent include a MEDIA:<path-or-url> line on its own line in its output:
Here you go.
MEDIA:./out/result.png
Notes:
- Prefer URLs or relative paths inside the agent workspace (e.g.
./out/...). That’s the most reliable across sandboxing/security. - Docs: https://docs.openclaw.ai/start/openclaw#media-in-and-out
FAQ entry: https://docs.openclaw.ai/help/faq#my-skill-generated-an-imagepdf-but-nothing-was-sent
2) Proactively send to a specific Discord channel id (any channel)
Use the outbound messaging pipeline (good for “send to channel X”):
CLI (easy to sanity-check first):
openclaw message send --channel discord \
--target channel:1481950909914288158 \
--media ./out/result.png \
--message "caption (optional)"
Target format is channel:<id> on Discord. Docs: https://docs.openclaw.ai/cli/message
Common gotcha
The image path must exist on the Gateway host filesystem (or inside its sandbox/workspace). If your Gateway is on a VPS but the image path is on your laptop, OpenClaw can’t read it unless you upload it (URL) or move/copy it into the workspace on the gateway host.
If you tell me: (a) where the images live (local machine vs VPS), and (b) whether you want to post in this thread vs a different channel, I can point you at the cleanest exact setup.
“Autonomously send images during conversations” boils down to: store a searchable index (text → image path), then teach the agent (via a skill / AGENTS.md) to consult that index and attach matching images.
Two important constraints up front:
-
OpenClaw does not “ingest” local images as knowledge automatically.
If you want the content of the image to help answers, you need a text description/OCR summary stored somewhere (index file / memory). The model can’t use a random file path as knowledge by itself. -
To actually attach an image, the agent must output
MEDIA:<path-or-url>(same chat) or use the outbound message tool (other chat).
Docs: https://docs.openclaw.ai/start/openclaw#media-in-and-out
Recommended pattern: an “Image KB” index + skill
1) Put images somewhere the gateway can read
Put them inside the agent workspace (best) so paths are stable and allowed, e.g.:
./kb/images/office-map.png./kb/images/product-arch.png
(If your gateway runs on a VPS, these files must exist on the VPS filesystem.)
2) Create an index file with descriptions/tags
Example ./kb/images/index.md:
# Image KB
- id: office-map
description: Floor plan of the Vienna office with room names.
tags: office, map, floorplan, vienna
path: ./kb/images/office-map.png
- id: product-arch
description: High-level architecture diagram of the ingestion pipeline.
tags: architecture, diagram, ingestion
path: ./kb/images/product-arch.png
3) Add a skill (or AGENTS.md rule) that retrieves + attaches
Create a skill ./skills/image-kb/SKILL.md that instructs:
- read
./kb/images/index.md - pick up to N relevant entries based on the user’s question
- reply with a short caption +
MEDIA:./kb/images/...lines
This makes the behavior consistent instead of “sometimes it remembers”.
Skill docs: https://docs.openclaw.ai/tools/skills
How the sending works in practice
Attach to the current conversation/thread
In the agent’s reply:
Here’s the architecture diagram for reference.
MEDIA:./kb/images/product-arch.png
OpenClaw will strip the MEDIA: line from visible text and send the image as an attachment.
Send to a different Discord channel
Then you need the outbound message tool / CLI (openclaw message send ...). Docs: https://docs.openclaw.ai/cli/message
(Also note cross-context restrictions; see FAQ: https://docs.openclaw.ai/help/faq#how-do-i-send-a-discord-message-from-telegram-crosscontext-messaging-denied)