Gif Whatsapp
Scanned@Shaharsha
npx machina-cli add skill @Shaharsha/gif-whatsapp --openclawGIF Sender
Send GIFs naturally in WhatsApp conversations.
CRITICAL: WhatsApp GIF Workflow
WhatsApp doesn't support direct Tenor/Giphy URLs. You MUST:
- Download the GIF
- Convert to MP4
- Send with
gifPlayback: true
Complete Workflow
Step 1: Search for GIF
gifgrep "SEARCH QUERY" --max 5 --format url
Search in English for best results.
Always get 5 results and pick the best one based on the filename/description - don't just take the first result.
Step 2: Download the GIF
curl -sL "GIF_URL" -o /tmp/gif.gif
Step 3: Convert to MP4
ffmpeg -i /tmp/gif.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" /tmp/gif.mp4 -y
Step 4: Send via message tool
message action=send to=NUMBER message="" filePath=/tmp/gif.mp4 gifPlayback=true
Note: Use invisible character (left-to-right mark, U+200E) as message to send GIF without visible caption.
One-liner Example
# Search
gifgrep "thumbs up" --max 3 --format url
# Pick best URL, then:
curl -sL "https://media.tenor.com/xxx.gif" -o /tmp/g.gif && \
ffmpeg -i /tmp/g.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" /tmp/g.mp4 -y 2>/dev/null
# Then send with message tool, gifPlayback=true
When to Send GIFs
✅ Good times:
- User asks for a GIF
- Celebrating good news
- Funny reactions
- Expressing emotions (excitement, facepalm, etc.)
❌ Don't overuse:
- One GIF per context is enough
- Not every message needs a GIF
Popular Search Terms
| Emotion | Search Terms |
|---|---|
| Happy | celebration, party, dancing, excited |
| Approval | thumbs up, nice, good job, applause |
| Funny | laugh, lol, haha, funny |
| Shocked | mind blown, shocked, surprised, wow |
| Sad | crying, sad, disappointed |
| Frustrated | facepalm, ugh, annoyed |
| Love | heart, love, hug |
| Cool | sunglasses, cool, awesome |
Security & Safety Notes
- Source domains: gifgrep only searches trusted GIF providers (Tenor, Giphy)
- File handling: All downloads go to
/tmpand are overwritten each time (-yflag) - Empty caption: The
character (U+200E, Left-to-Right Mark) is used as an invisible caption so WhatsApp sends the GIF without visible text. This is a standard Unicode control character, not an injection technique - WhatsApp integration: Uses the platform's built-in
messagetool — no separate WhatsApp credentials needed - ffmpeg safety: Processes only GIF files from trusted providers; no arbitrary file execution
Why This Works
- WhatsApp converts all GIFs to MP4 internally
- Direct Tenor/Giphy URLs often fail
- MP4 with
gifPlayback=truedisplays as looping GIF - Small file size = fast delivery
Overview
gif-whatsapp lets you search Tenor/Giphy for GIFs using gifgrep, downloads the selected GIF to /tmp, converts it to MP4, and sends it through the platform's message tool with gifPlayback enabled so WhatsApp displays it as a looping GIF. It handles the Tenor→MP4 conversion required for WhatsApp and cleans up temporary files after sending.
How This Skill Works
The skill searches for GIFs with gifgrep (max 5 results), downloads the chosen URL to /tmp via curl, converts the GIF to an MP4 using ffmpeg with faststart and yuv420p, and finally sends the file through the platform's message tool with gifPlayback=true. An invisible caption using the left-to-right mark (U+200E) is added so WhatsApp sends the GIF without visible text.
When to Use It
- When a user asks for a GIF in chat
- To celebrate good news with a quick visual
- For funny reactions that land better as a moving image
- To express emotions like excitement or disbelief
- When you want a lightweight, caption-free GIF reply
Quick Start
- Step 1: Search for GIFs with gifgrep 'QUERY' --max 5 --format url
- Step 2: Download the chosen URL and convert to MP4: curl -sL 'GIF_URL' -o /tmp/g.gif; ffmpeg -i /tmp/g.gif -movflags faststart -pix_fmt yuv420p -vf 'scale=trunc(iw/2)*2:trunc(ih/2)*2' /tmp/g.mp4 -y
- Step 3: Send via the platform message tool: message action=send to=NUMBER message='' filePath=/tmp/g.mp4 gifPlayback=true
Best Practices
- Always fetch 5 results and pick the best one based on filename/description
- Use gifgrep --max 5 and evaluate multiple URLs before downloading
- Download to /tmp and convert with ffmpeg using faststart and yuv420p
- Send the MP4 with the message tool using filePath and gifPlayback=true, and use an invisible caption
- Clean up /tmp files after sending and rely on trusted GIF providers (Tenor/Giphy)
Example Use Cases
- gifgrep 'thumbs up' --max 3 --format url
- curl -sL 'https://media.tenor.com/xxx.gif' -o /tmp/g.gif
- ffmpeg -i /tmp/g.gif -movflags faststart -pix_fmt yuv420p -vf 'scale=trunc(iw/2)*2:trunc(ih/2)*2' /tmp/g.mp4 -y
- message action=send to=USER_NUMBER message='' filePath=/tmp/g.mp4 gifPlayback=true
- WhatsApp displays the GIF without a visible caption thanks to the invisible caption (U+200E)