From dbdf03111c3e982e4a5d850f2ca1889b2c3ae9a0 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 4 Feb 2026 13:29:32 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Redesign=20README=20with=20professi?= =?UTF-8?q?onal=20styling=20and=20enhanced=20documentation=20=20-=20Add=20?= =?UTF-8?q?centered=20header=20with=20e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 338 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 257 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index 0c533f4..bf882cf 100644 --- a/README.md +++ b/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). +
+

🤖 OpenClaw x Z.AI Integration Guide

+

A professional setup guide for OpenClaw with Z.AI (GLM 4.7) | Powered by Z.AI Community

+ + [![Discord](https://img.shields.io/badge/Discord-Bot%20Framework-5865F2?style=for-the-badge&logo=discord)](https://discord.com/) + [![Z.AI](https://img.shields.io/badge/Z.AI-GLM%204.7-FF6B6B?style=for-the-badge)](https://z.ai/) + [![Python](https://img.shields.io/badge/Python-3.8%2B-3776AB?style=for-the-badge&logo=python)](https://python.org) + [![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)](LICENSE) +
+ +--- + +## 📄 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 + +
+Click to expand quick start guide + +```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 +``` + +
+ +--- + +## 📝 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. + +--- + +
+

Credit: cobrax91310 on Discord | Z.AI Community

+

Made with ❤️ for the Discord Bot community

+
\ No newline at end of file