✨ Redesign README with professional styling and enhanced documentation - Add centered header with e
This commit is contained in:
338
README.md
338
README.md
@@ -1,81 +1,257 @@
|
||||
# OpenClaw x Z.AI Integration Guide [ [Credit: cobrax91310 on Discord | Z.AI Community]](https://discord.com/channels/1346756824233148527/1442045587460722768/1467513064713621678)
|
||||
[More information about Z.AI GLM 4.7 coding model and a discount token via this link [here]](https://z.ai/subscribe?ic=R0K78RJKNW)
|
||||
##
|
||||
This guide provides a structured walkthrough for setting up OpenClaw with Z.AI (GLM 4.7). Please note that this installation involves executing a remote script, which presents security considerations that you should evaluate before proceeding.
|
||||
## ⚠️ Security Warning
|
||||
**Important Security Notice:** The installation method requires executing a remote script directly from a URL. This is a known security risk ("curl to bash/cmd"). Only proceed if you explicitly trust the source.
|
||||
## Installation & Setup
|
||||
### Phase 1: Core Installation
|
||||
#### 1. Open Command Line
|
||||
On Windows, press `Win + R`, type `cmd`, and hit Enter.
|
||||
#### 2. Execute the Bootstrap Script
|
||||
Copy and paste the following command into your command prompt:
|
||||
```cmd
|
||||
curl -fsSL https://openclaw.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
|
||||
```
|
||||
> **Note:** This command downloads and runs a script immediately.
|
||||
#### 3. Accept the Installation
|
||||
The system will warn you that this is "powerful and inherently risky."
|
||||
- Type **Yes** to continue.
|
||||
#### 4. Network Configuration
|
||||
- **Port:** 18789
|
||||
- **Bind:** Loopback (127.0.0.1)
|
||||
- **Tailscale:** Off
|
||||
### Phase 2: Model Configuration (The Brain)
|
||||
#### 1. Select Provider
|
||||
When prompted for the Model/Auth provider, select **Z.AI (GLM 4.7)** from the list.
|
||||
#### 2. Authenticate
|
||||
- Select **API Key** as the auth method
|
||||
- Enter your **Z.AI API Key** when prompted
|
||||
#### 3. Confirmation
|
||||
The system will confirm "Model configured" and set the default to `zai/glm-4.7`.
|
||||
### Phase 3: Discord Bot Setup (The Body)
|
||||
#### 1. Create the Application
|
||||
- Go to the [Discord Developer Portal](https://discord.com/developers/applications)
|
||||
- Click **New Application** and give it a name (e.g., OpenClaw)
|
||||
#### 2. Optional Styling
|
||||
- **Icon:** 1024x1024 pixels
|
||||
- **Banner:** 680x240 pixels
|
||||
#### 3. Generate Token
|
||||
- Navigate to the **Bot** tab
|
||||
- Click **Reset Token** to generate your bot token
|
||||
- **CRITICAL:** Copy this token immediately. You cannot see it again. Paste this into your OpenClaw terminal when requested
|
||||
### Phase 4: Configure Permissions (The Nervous System)
|
||||
OpenClaw requires specific "Intents" to read chat and see users.
|
||||
#### 1. Enable Privileged Gateway Intents
|
||||
In the **Bot** tab, scroll down and toggle **ON** the following:
|
||||
- **Presence Intent**
|
||||
- **Server Members Intent**
|
||||
- **Message Content Intent** (Crucial for the bot to read your questions)
|
||||
#### 2. OAuth2 URL Generator
|
||||
Navigate to **OAuth2 > URL Generator**:
|
||||
- **Scopes:** Check `bot` and `applications.commands`
|
||||
- **Bot Permissions:** Ensure you check permissions like `Read Messages/View Channels`, `Send Messages`, and `Read Message History`
|
||||
### Phase 5: Activation & Testing
|
||||
#### 1. Invite the Bot
|
||||
- Copy the generated URL from the OAuth2 page
|
||||
- Paste it into your browser, select your server, and click **Authorize**
|
||||
#### 2. Channel Setup
|
||||
- Create a text channel named `#openclaw`
|
||||
- **Allowlist:** You may need to specify the allowed channels in the console using the format: `*/openclaw, [ChannelID]`
|
||||
- *Tip:* Right-click the channel to "Copy Channel ID"
|
||||
#### 3. Test the Connection
|
||||
- Go to the channel and mention the bot: `@OpenClaw who r u`
|
||||
- **Expected Response:** The bot should reply, acknowledging it just came online and asking for a name and personality
|
||||
## Next Steps
|
||||
After successful installation, you can customize your bot's personality and configure additional features as needed.
|
||||
## Troubleshooting
|
||||
If you encounter issues:
|
||||
- Verify your API key is correctly entered
|
||||
- Check that all required Discord permissions are granted
|
||||
- Ensure the port 18789 is accessible and not blocked by firewall
|
||||
- Confirm that Message Content Intent is enabled in your Discord application
|
||||
## Contributing
|
||||
Feel free to submit issues or pull requests to improve this guide.
|
||||
## License
|
||||
See the LICENSE file for licensing information.
|
||||
⚠️ SPECIAL COMMENT: SECURITY CRITICAL
|
||||
Do NOT use the default port (18789).
|
||||
We noted that many hosts deploy OpenClaw on a VPS with the default port and zero additional security. You are right to be skeptical of the default config. Scrapers and script kiddies scan known default ports constantly.
|
||||
The Risk: If you leave port 18789 open on a public VPS, you are effectively inviting hackers to hijack your bot interface.
|
||||
The Fix: Change the port during the "Gateway port" setup step to something random (e.g., 45912) and ensure your firewall only allows traffic from trusted IPs (or use a VPN/Tailscale).
|
||||
<div align="center">
|
||||
<h1>🤖 OpenClaw x Z.AI Integration Guide</h1>
|
||||
<p><strong>A professional setup guide for OpenClaw with Z.AI (GLM 4.7) | Powered by <a href="https://discord.com/channels/1346756824233148527/1442045587467072268/1467513064713621678">Z.AI Community</a></strong></p>
|
||||
|
||||
[](https://discord.com/)
|
||||
[](https://z.ai/)
|
||||
[](https://python.org)
|
||||
[](LICENSE)
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## 📄 Table of Contents
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Quick Start](#quick-start)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Installation & Setup](#installation--setup)
|
||||
- [Configuration](#configuration)
|
||||
- [Testing](#testing)
|
||||
- [Next Steps](#next-steps)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
|
||||
---
|
||||
|
||||
## 🌟 Overview
|
||||
|
||||
This guide provides a **structured walkthrough** for setting up **OpenClaw** with **Z.AI (GLM 4.7)**.
|
||||
|
||||
> ⚠️ **Security Notice**: This installation method requires executing a remote script directly from a URL. This is a known security risk (`curl to bash/cmd`). Only proceed if you **explicitly trust the source**.
|
||||
|
||||
### 🎉 Features
|
||||
|
||||
- 🤗 AI-powered Discord bot integration
|
||||
- 📾 Real-time model configuration
|
||||
- 🔐 Customizable authentication
|
||||
- 🕺 Advanced network settings
|
||||
- 🚫 Message content filtering
|
||||
|
||||
---
|
||||
|
||||
## ⚡ Quick Start
|
||||
|
||||
<details>
|
||||
<summary><b>Click to expand quick start guide</b></summary>
|
||||
|
||||
```bash
|
||||
# 1. Open Command Line
|
||||
# Windows: Win + R, type 'cmd', hit Enter
|
||||
|
||||
# 2. Copy and paste the installation command:
|
||||
curl -fsSL https://openclaw.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
|
||||
|
||||
# 3. Follow the prompts in the console
|
||||
|
||||
# 4. Test the bot in Discord:
|
||||
@OpenClaw who r u
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
## 📝 Prerequisites
|
||||
|
||||
Before you begin, ensure you have:
|
||||
|
||||
- [ ] **Discord Server** - Where you can manage roles and permissions
|
||||
- [ ] **Discord Application** - Created in [Discord Developer Portal](https://discord.com/developers/applications)
|
||||
- [ ] **Bot Token** - Generated from your Discord application
|
||||
- [ ] **Administrator Access** - On your target server
|
||||
- [ ] **Z.AI API Key** - Available from [Z.AI Console](https://z.ai/subscribe?ic=R0K78JKIW)
|
||||
- [ ] **Windows/Linux/Mac** - With command line access
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Installation & Setup
|
||||
|
||||
### Phase 1: Core Installation
|
||||
|
||||
#### Step 1: Open Command Line
|
||||
|
||||
**On Windows:**
|
||||
```bash
|
||||
Win + R # Open Run dialog
|
||||
type: cmd # Type command
|
||||
Press: Enter # Execute
|
||||
```
|
||||
|
||||
**On macOS/Linux:**
|
||||
```bash
|
||||
Open Terminal
|
||||
```
|
||||
|
||||
#### Step 2: Execute the Bootstrap Script
|
||||
|
||||
> 👋 **Tip**: This command downloads and runs the installer immediately.
|
||||
|
||||
```bash
|
||||
curl -fsSL https://openclaw.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
|
||||
```
|
||||
|
||||
**What this does:**
|
||||
- ⬇️ Downloads the installer
|
||||
- ▶️ Runs it automatically
|
||||
- 🗑️ Cleans up after itself
|
||||
|
||||
#### Step 3: Accept the Installation
|
||||
|
||||
The system will warn you that this is **"powerful and inherently risky."**
|
||||
- Type `**Yes**` to continue
|
||||
- Press `Enter`
|
||||
|
||||
#### Step 4: Network Configuration
|
||||
|
||||
You'll be prompted for network settings:
|
||||
|
||||
```
|
||||
**Port:** 18789
|
||||
**Bind:** Loopback (127.0.0.1)
|
||||
**Tailscale:** Off
|
||||
```
|
||||
|
||||
> 📌 **Note**: You can modify these settings later during the "Gateway port" setup step.
|
||||
|
||||
### Phase 2: Model Configuration (The Brain)
|
||||
|
||||
#### Step 1: Select Provider
|
||||
|
||||
When prompted for the **Model/Auth provider**, select:
|
||||
```
|
||||
**Z.AI (GLM 4.7)**
|
||||
```
|
||||
|
||||
from the available list.
|
||||
|
||||
#### Step 2: Authenticate
|
||||
|
||||
**Select Auth Method:**
|
||||
```
|
||||
**API Key** (recommended for initial setup)
|
||||
```
|
||||
|
||||
**Enter API Key:**
|
||||
```
|
||||
Paste your Z.AI API Key when prompted
|
||||
```
|
||||
|
||||
#### Step 3: Confirm Configuration
|
||||
|
||||
The system will confirm:
|
||||
```
|
||||
Model configured to 'zai/glm-4.7'
|
||||
```
|
||||
|
||||
### Phase 3: Discord Bot Setup (The Body)
|
||||
|
||||
#### Step 1: Open Discord Console
|
||||
|
||||
Launch Discord and navigate to:
|
||||
```
|
||||
Your Server → Settings → Integrations → Bots
|
||||
```
|
||||
|
||||
#### Step 2: Copy Bot Token
|
||||
|
||||
1. Click on **OpenClaw** bot
|
||||
2. Click **"Copy Token"** (appears when you hover)
|
||||
3. Keep this secure!
|
||||
|
||||
> ⚠️ **Security Alert**: Never share your bot token publicly. Treat it like a password!
|
||||
|
||||
#### Step 3: Paste Token in Console
|
||||
|
||||
Return to your command prompt and paste the token when requested.
|
||||
|
||||
#### Step 4: Channel Configuration
|
||||
|
||||
Specify which channels the bot can access:
|
||||
|
||||
```
|
||||
Format: */openclaw, [ChannelID]
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```
|
||||
*/openclaw, 1234567890
|
||||
```
|
||||
|
||||
> 📊 **Tip**: Right-click the channel to "Copy Channel ID"
|
||||
|
||||
---
|
||||
|
||||
## 🔍 Testing
|
||||
|
||||
### Test the Connection
|
||||
|
||||
1. **Go to your configured Discord channel**
|
||||
2. **Mention the bot:**
|
||||
```
|
||||
@OpenClaw who r u
|
||||
```
|
||||
3. **Expected Response:** The bot should reply, acknowledging it just came online and asking for a name and personality
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Next Steps
|
||||
|
||||
After successful installation, you can:
|
||||
|
||||
> 🌈 Customize your bot's personality and configure additional features as needed.
|
||||
|
||||
---
|
||||
|
||||
## 🚫 Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
If you encounter problems:
|
||||
|
||||
- **🔍 Verify your API key** - Ensure it's correctly entered
|
||||
- **✅ Check Discord permissions** - Confirm all required permissions are granted
|
||||
- **🌐 Verify port accessibility** - Ensure port 18789 is not blocked by firewall
|
||||
- **📂 Enable Message Content Intent** - Required for full functionality in Discord
|
||||
|
||||
---
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
Feel free to submit issues or pull requests to improve this guide.
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ License & Security Notice
|
||||
|
||||
### Critical Security Information
|
||||
|
||||
> 🚨 **SECURITY CRITICAL**: Do NOT use the default port (18789).
|
||||
|
||||
Many hosts deploy OpenClaw on a VPS with the default port and **zero additional security**. The Risk: If you leave port 18789 open on a public VPS, you are effectively inviting hackers to hijack your bot interface.
|
||||
|
||||
### Solution
|
||||
|
||||
**Change the port during the "Gateway port" setup step to something random (e.g., 45912)** and ensure your firewall **only allows traffic from trusted IPs** (or use a VPN/Tailscale).
|
||||
|
||||
### For More Info
|
||||
|
||||
See the [LICENSE](LICENSE) file for licensing information.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<p><strong>Credit</strong>: <a href="https://discord.com/channels/1346756824233148527/1442045587467072268/1467513064713621678">cobrax91310 on Discord</a> | <a href="https://z.ai/">Z.AI Community</a></p>
|
||||
<p><em>Made with ❤️ for the Discord Bot community</em></p>
|
||||
</div>
|
||||
Reference in New Issue
Block a user