من التثبيت إلى ربط Telegram و Discord و WhatsApp
المتطلبات الأساسية للنظام
| الشرط | التفاصيل | الحالة |
|---|---|---|
| Node.js | الإصدار 24.16+ أو 26.1+ (Node 26 هو الموصى بيه) | ✓ |
| API Key | من أي provider (Anthropic، OpenAI، Google، إلخ) | ✓ |
| RAM | 2 GB على الأقل (لو هتبني Docker image) | ✓ |
| Disk | مساحة كافية للـ images والـ logs | ✓ |
# تحقق من نسخة Node.js
node --version
# المفروض يطلعلك حاجة زي v24.16.0 أو v26.1.0 أو أعلى
4 طرق رسمية لتثبيت OpenClaw
# macOS / Linux — Install Script
curl -fsSL https://openclaw.ai/install.sh | bash
# Windows (PowerShell)
iwr -useb https://openclaw.ai/install.ps1 | iex
# npm Global Install
npm install -g openclaw@latest
# Docker
git clone https://github.com/openclaw/openclaw.git
cd openclaw
export OPENCLAW_IMAGE="ghcr.io/openclaw/openclaw:latest"
./scripts/docker/setup.sh
openclaw onboard — الـ Onboarding Wizard
# تشغيل الـ Onboarding Wizard
openclaw onboard --install-daemon
# Quick Start (الأسرع)
npx openclaw@latest
# Classic Wizard
openclaw onboard --classic
# Non-Interactive (للـ automation)
openclaw onboard --non-interactive --accept-risk --mode local \
--auth-choice openai-api-key \
--secret-input-mode ref \
--gateway-auth token \
--gateway-token-ref-env OPENCLAW_GATEWAY_TOKEN \
--skip-channels \
--no-install-daemon
# Baseline Setup (بدون Wizard)
openclaw setup --baseline
فهم ملف الإعدادات — JSON5 format
{
// Gateway settings
gateway: {
mode: "local",
bind: "loopback",
port: 18789,
auth: {
mode: "token",
token: "your-token-here"
}
},
// Agent defaults
agents: {
defaults: {
workspace: "~/.openclaw/workspace",
model: {
primary: "anthropic/claude-sonnet-4-6",
fallbacks: ["openai/gpt-5.4"]
},
thinkingDefault: "high",
timeoutSeconds: 1800,
heartbeat: { every: "0m" }
}
},
// Channels
channels: {
telegram: {
enabled: true,
botToken: "123:abc",
dmPolicy: "pairing",
groups: { "*": { requireMention: true } }
},
discord: {
enabled: true,
token: "your-discord-token"
},
whatsapp: {
enabled: true,
dmPolicy: "pairing",
allowFrom: ["+155****0123"]
}
},
// Session management
session: {
dmScope: "per-channel-peer",
reset: { mode: "daily", atHour: 4, idleMinutes: 120 }
}
}
تشغيل الـ Gateway وأوامر مفيدة
# تشغيل مؤقت
openclaw gateway --port 18789 --verbose
# تشغيل في الخلفية (Daemon)
openclaw gateway install
# التحقق من التشغيل
openclaw gateway status
# فتح الـ Dashboard
openclaw dashboard
# أو افتح في المتصفح: http://127.0.0.1:18789
# أوامر مفيدة
openclaw gateway restart # Restart
openclaw gateway stop # Stop
openclaw gateway status --deep # Status مفصل
openclaw logs --follow # مشاهدة الـ logs مباشرة
إنشاء بوت Telegram وربطه بـ OpenClaw
# ربط البوت بـ OpenClaw (الطريقة 1: CLI)
openclaw channels add --channel telegram --token <bot-token>
# الطريقة 2: تعديل الـ Config مباشرة
# أضف في ~/.openclaw/openclaw.json:
{
channels: {
telegram: {
enabled: true,
botToken: "123:abc",
dmPolicy: "pairing",
groups: { "*": { requireMention: true } }
}
}
}
# التحقق من القناة
openclaw channels status --probe
# الموافقة على الـ pairing
openclaw pairing list telegram
openclaw pairing approve telegram <CODE>
إنشاء بوت Discord وربطه بـ OpenClaw
# ربط البوت بـ OpenClaw
export DISCORD_BOT_TOKEN="YOUR_BOT_TOKEN"
cat > discord.patch.json5 <<'JSON5'
{
channels: {
discord: {
enabled: true,
token: { source: "env", provider: "default", id: "DISCORD_BOT_TOKEN" }
}
}
}
JSON5
openclaw config patch --file ./discord.patch.json5 --dry-run
openclaw config patch --file ./discord.patch.json5
openclaw gateway
# التحقق
openclaw channels status --probe
ربط حساب WhatsApp عبر QR Code
# تثبيت الـ Plugin
openclaw plugins install @openclaw/whatsapp
# أو لو بتشغل من Docker
export OPENCLAW_EXTENSIONS=whatsapp
./scripts/docker/setup.sh
# ربط الحساب (QR Login)
openclaw channels login --channel whatsapp
# التحقق
openclaw channels status --probe
# تسجيل الخروج
openclaw channels logout --channel whatsapp
أخطاء شائعة وحلولها
# تشخيص المشاكل
openclaw doctor
openclaw doctor --fix
openclaw logs --follow
# Config Validation Error
openclaw config schema
openclaw doctor --fix
# Node.js Version قديم
node --version
# لو أقل من 24.16، حدّث Node.js
nvm install 26
nvm use 26
طرق التحديث المتاحة
# التحديث التلقائي (موصى بيه)
openclaw update
# التحديث اليدوي عبر npm
openclaw gateway stop
npm install -g openclaw@latest --allow-scripts=openclaw
openclaw doctor --fix
openclaw gateway start
openclaw gateway status --deep
# التحديث عبر pnpm
openclaw gateway stop
pnpm add -g --allow-build=openclaw openclaw@latest
openclaw doctor --fix
openclaw gateway start
# التحديث عبر Docker
docker compose pull openclaw-gateway openclaw-cli
docker compose up -d openclaw-gateway
# اختيار قناة التحديث
openclaw update --channel beta
openclaw update --channel extended-stable
openclaw update --dry-run # معاينة من غير تطبيق
مشروع عملي — طبق اللي اتعلمته
كل الأوامر اللي محتاجها في مكان واحد
# التثبيت
curl -fsSL https://openclaw.ai/install.sh | bash
npm install -g openclaw@latest
# Onboarding
openclaw onboard --install-daemon
openclaw setup --baseline
# Gateway
openclaw gateway status
openclaw gateway install
openclaw gateway restart
openclaw dashboard
# Telegram
openclaw channels add --channel telegram --token <token>
openclaw pairing list telegram
openclaw pairing approve telegram <CODE>
# Discord
openclaw channels add --channel discord --token <token>
# WhatsApp
openclaw plugins install @openclaw/whatsapp
openclaw channels login --channel whatsapp
# التشخيص
openclaw doctor
openclaw triage
openclaw status --all
openclaw channels status --probe
openclaw logs --follow
# التحديث
openclaw update
اختبر معلوماتك — 5 أسئلة
في Module 3 هنتعلم نربط OpenClaw بـ Hermes Agent