OpenClaw
Complete guide for OpenClaw installation, Discord configuration, and sending messages, including common issues and solutions
Best use case
OpenClaw is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Complete guide for OpenClaw installation, Discord configuration, and sending messages, including common issues and solutions
Teams using OpenClaw should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/OpenClaw/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How OpenClaw Compares
| Feature / Agent | OpenClaw | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Complete guide for OpenClaw installation, Discord configuration, and sending messages, including common issues and solutions
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 📚 OpenClaw Installation and Discord Configuration Guide
## 1. Environment Setup
### 1.1 System Requirements
- **Node.js**: v22.16.0+ (required)
- **npm**: Installed with Node.js
- **pnpm**: Must be installed globally
- **Git**: For cloning the repository
### 1.2 PATH Issues (Important!)
On macOS, Node.js may not be in the default PATH; you may need to specify it explicitly:
```bash
/usr/local/bin/node --version
/usr/local/bin/npm --version
```
**Solution**: Prepend `export PATH="/usr/local/bin:$PATH"` before running commands.
---
## 2. Installation Steps
### 2.1 Clone the Repository
```bash
git clone https://github.com/openclaw/openclaw.git
cd openclaw
```
### 2.2 Install Dependencies
```bash
# Install pnpm (if not already installed)
/usr/local/bin/node /usr/local/bin/npm install -g pnpm
# Install project dependencies
export PATH="/usr/local/bin:$PATH"
npm install
```
### 2.3 Build the Project
```bash
export PATH="/usr/local/bin:$PATH"
pnpm build
```
**⚠️ Note**: The build takes about 20–30 seconds and produces the `dist/` directory.
---
## 3. Basic Configuration
### 3.1 Set Gateway Mode
```bash
export PATH="/usr/local/bin:$PATH"
node dist/index.js config set gateway.mode '"local"' --json
```
### 3.2 Configuration File Locations
- **Main config**: `~/.openclaw/openclaw.json`
- **Log files**: `/tmp/openclaw/openclaw-YYYY-MM-DD.log`
---
## 4. Discord Configuration
### 4.1 Create a Discord Bot
1. Go to https://discord.com/developers/applications
2. Create New Application → Bot
3. **Required intents**:
- ✅ Message Content Intent
- ✅ Server Members Intent
4. Copy the Bot Token (format: `MTQ3...`)
5. Invite the bot to your server using the OAuth2 URL
### 4.2 Configure Discord Channel
```bash
# Enable Discord
node dist/index.js config set channels.discord.enabled 'true' --json
# Set Bot Token
node dist/index.js config set channels.discord.token '"YOUR_BOT_TOKEN"' --json
```
### 4.3 Verify Configuration
```bash
cat ~/.openclaw/openclaw.json
```
It should include:
```json
{
"channels": {
"discord": {
"enabled": true,
"token": "YOUR_BOT_TOKEN"
}
},
"gateway": {
"mode": "local"
}
}
```
---
## 5. Starting the Gateway
### 5.1 Run in Background (Recommended)
```bash
export PATH="/usr/local/bin:$PATH"
cd openclaw
# Run in background with nohup
nohup node dist/index.js gateway --port 18789 > /tmp/gateway.log 2>&1 &
# Check process
ps aux | grep openclaw-gateway | grep -v grep
```
### 5.2 Verify Gateway Status
```bash
# Check port
lsof -i :18789
# Check channel status
node dist/index.js channels status --probe
```
---
## 6. Sending Discord Messages
### 6.1 Command Format
```bash
node dist/index.js message send \
--channel discord \
--target "user:USER_ID" \
--message "Message content"
```
### 6.2 Full Example
```bash
export PATH="/usr/local/bin:$PATH"
cd openclaw
node dist/index.js message send \
--channel discord \
--target "user:USER_ID" \
--message "🦞 Hello from OpenClaw!"
```
---
## 7. Troubleshooting
### 7.1 Discord Connection Failed: `fetch failed`
**Symptoms**:
```
Error: Failed to get gateway information from Discord: fetch failed
discord: failed to deploy native commands: fetch failed
```
**Possible causes**:
1. **Invalid Bot Token** – Token revoked or expired
2. **Network issues** – Cannot reach discord.com
3. **Intents not enabled** – Message Content Intent is disabled
**Solution**:
```bash
# Verify token
curl -H "Authorization: Bot YOUR_TOKEN" \
https://discord.com/api/v10/users/@me
```
### 7.2 Gateway Exits Right After Starting
**Symptoms**: Gateway process starts then exits immediately.
**Solution**:
- Check logs: `tail -f /tmp/openclaw/openclaw-YYYY-MM-DD.log`
- Ensure Discord token is valid
- Use `nohup` so it keeps running in the background
### 7.3 `TypeError: fetch failed` When Sending Messages
**Cause**: Gateway not running or Discord not connected.
**Solution**:
1. Check if Gateway is running: `ps aux | grep openclaw-gateway`
2. Check Discord status: `node dist/index.js channels status --probe`
3. Restart Gateway and wait for Discord to connect (about 5–10 seconds)
---
## 8. Command Quick Reference
| Action | Command |
|--------|--------|
| Build project | `pnpm build` |
| Start Gateway | `nohup node dist/index.js gateway --port 18789 > /tmp/gateway.log 2>&1 &` |
| View config | `cat ~/.openclaw/openclaw.json` |
| Set config | `node dist/index.js config set KEY 'VALUE' --json` |
| Send message | `node dist/index.js message send --channel discord --target "user:ID" --message "content"` |
| Check status | `node dist/index.js channels status --probe` |
| View logs | `tail -f /tmp/openclaw/openclaw-YYYY-MM-DD.log` |
---
## 9. Best Practices
1. **Use full paths**: `/usr/local/bin/node` instead of `node`
2. **Run Gateway in background**: Use `nohup` and `&`
3. **Wait for connection**: Discord needs 5–10 seconds to connect; do not send messages immediately
4. **Verify token**: Use curl to verify the Bot token before use
5. **Check logs**: When something fails, check the log file first
---Related Skills
xhs-scraper
小红书搜索抓取 skill - 通过 agent-browser (CDP) 抓取小红书搜索结果,支持列表+详情、多格式输出。使用场景:按关键词抓取笔记列表与正文、生成 RSS/JSON/Markdown。
xhs-publisher
小红书发布 skill - 通过 agent-browser (CDP) 自动发布小红书图文笔记,支持多图上传、标题正文填写、一键发布。使用场景:自动化发布图文笔记到小红书创作中心。
read large webpage or knowledge
This skill is used for segmented reading and organization when facing large-scale knowledge bases or web pages. It captures original content segment by segment, summarizes key points in real-time, and continuously deposits them into the knowledge base, ensuring orderly information ingestion, clear structure, and traceability.
text2agent
Creates new agents from user requirements by generating Python implementation and mcp_config.
optimizer
Analyzes and automatically optimizes existing agents by improving system prompts and tool configuration.
media_comprehension
An intelligent assistant specialized in handling media files (images/audio/video). **Only for media file analysis**, does not handle document types.\n\n✅ Media files that can be processed:\n- Images: .jpg, .jpeg, .png, .gif, .bmp, .webp, .svg\n- Audio: .mp3, .wav, .m4a, .flac, .aac, .ogg\n- Video: .mp4, .avi, .mov, .mkv, .webm, .flv\n\n❌ Files that cannot be processed (please do not trigger this skill):\n- Documents: .pdf, .doc, .docx, .txt, .md, .rtf\n- Spreadsheets: .xlsx, .xls, .csv, .tsv\n- Presentations: .pptx, .ppt, .key\n- Code: .py, .js, .ts, .java, .cpp, .go, .rs\n- Archives: .zip, .tar, .gz, .rar, .7z\n- Executables: .exe, .bin, .app, .dmg\n- Databases: .db, .sqlite, .sql\n- Configuration files: .json, .xml, .yaml, .yml, .toml, .ini\n- Web pages: .html, .htm, .css\n\n**Trigger conditions**: When the user explicitly requests to analyze image/audio/video content, or when the file extension belongs to the aforementioned media types.".
app_evaluator
A professional skill for App Evaluation (evaluating app's performance with score) and App Improvement (giving professional suggestions for improving the app's performance).
agent-browser
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
x-scraper
X (Twitter) 抓取 skill - 通过 agent-browser (CDP) 抓取指定用户推文或首页推荐流,支持关键词过滤、Tab 切换、多格式输出。使用场景:按用户/关键词抓取时间线、查看首页推荐流、生成 RSS/JSON/Markdown。
html-to-image
HTML 转图片 skill - 将 HTML 文件或内容通过 agent-browser 渲染并截图为图片。适用于生成信息图、社交媒体配图、数据可视化截图等场景。
openclaw-youtube
YouTube SERP Scout for agents. Search top-ranking videos, channels, and trends for content research and competitor tracking.
openclaw-search
Intelligent search for agents. Multi-source retrieval with confidence scoring - web, academic, and Tavily in one unified API.