计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
giphy-gif【效率与协作】Search and send contextual GIFs from Giphy in Discord conversations. Use when the user wants to react with a GIF, express emotions with a GIF, or when you determine a GIF would enhance the conversation (celebrations, reactions, emotions, humor). Triggers on requests like "send a GIF", "show me a GIF", or when context suggests a GIF reaction would be …
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
This skill enables searching for and sending contextually appropriate GIFs from Giphy's library in Discord conversations.
Before using this skill, you need a Giphy API key:
export GIPHY_API_KEY="your-api-key-here"Add to ~/.openclaw/openclaw.json:
{
"skills": {
"entries": {
"giphy-gif": {
"apiKey": "your-api-key-here"
}
}
}
}
Use this one-liner to search and get a Giphy URL:
# Basic search
exec("QUERY='excited'; API_KEY=$(jq -r '.skills.entries.\"giphy-gif\".apiKey // env.GIPHY_API_KEY' ~/.openclaw/openclaw.json 2>/dev/null || echo \"$GIPHY_API_KEY\"); curl -s \"https://api.giphy.com/v1/gifs/search?api_key=${API_KEY}&q=$(printf '%s' \"$QUERY\" | jq -sRr @uri)&limit=1&rating=g\" | jq -r '.data[0].url // empty'")
# 1. Define your search query
query="happy dance"
# 2. Get GIF URL using the helper function below
gif_url=$(exec("QUERY='$query'; API_KEY=$(jq -r '.skills.entries.\"giphy-gif\".apiKey // env.GIPHY_API_KEY' ~/.openclaw/openclaw.json 2>/dev/null || echo \"$GIPHY_API_KEY\"); curl -s \"https://api.giphy.com/v1/gifs/search?api_key=${API_KEY}&q=$(printf '%s' \"$QUERY\" | jq -sRr @uri)&limit=1&rating=g\" | jq -r '.data[0].url // empty'"))
# 3. Send to Discord
message(action="send", message=gif_url)
For easier use, create this helper in your commands:
# Function to search GIF (copy this pattern)
search_gif() {
local query="$1"
local api_key
# Try OpenClaw config first, then env var
api_key=$(jq -r '.skills.entries."giphy-gif".apiKey // empty' ~/.openclaw/openclaw.json 2>/dev/null)
[[ -z "$api_key" ]] && api_key="$GIPHY_API_KEY"
if [[ -z "$api_key" ]]; then
echo "Error: GIPHY_API_KEY not configured" >&2
return 1
fi
# URL encode and search
local encoded_query=$(printf '%s' "$query" | jq -sRr @uri)
curl -s "https://api.giphy.com/v1/gifs/search?api_key=${api_key}&q=${encoded_query}&limit=1&rating=g&lang=en" | jq -r '.data[0].url // empty'
}
# Usage:
# gif_url=$(search_gif "excited")
# message(action="send", message="$gif_url")
When you send a Giphy URL to Discord, it will automatically embed as an animated GIF. No additional steps needed.
Send GIFs in these situations:
Be thoughtful about when to send GIFs to maintain natural conversation flow:
Goal: Make GIF usage feel natural and contextual, not automatic or overwhelming.
thumbs up, facepalm, eye roll, shocked, confusedexcited, happy, sad, angry, love, cryingdance, clap, wave, thinking, workingparty, celebrate, success, winnerfunny, lol, wtf, awkward, failbash, curl, jq (standard on Linux/macOS/WSL)Get started with a free beta key at developers.giphy.com.
"Unauthorized" error:
~/.openclaw/openclaw.json or $GIPHY_API_KEYNo GIF returned:
jq not found:
sudo apt install jq (Linux) or brew install jq (macOS)