← Back to Plugins
Channels

Go Cqhttp

Fizzzli By Fizzzli 👁 24 views ▲ 0 votes

go-cqhttp channel plugin for OpenClaw - QQ bot integration via reverse WebSocket

GitHub

Install

npm install
```

Configuration Example

servers:
  - ws-reverse:
      # If go-cqhttp runs on host (Linux):
      universal: ws://192.168.x.1:8080/ws?access_token=your-secret-token
      
      # If go-cqhttp runs on host (macOS/Windows):
      # universal: ws://host.docker.internal:8080/ws
      
      # If go-cqhttp runs in another container on same network:
      # universal: ws://openclaw:8080/ws

README

# go-cqhttp Plugin for OpenClaw

QQ bot integration via go-cqhttp reverse WebSocket.

## Features

- ✅ Reverse WebSocket server (go-cqhttp connects to OpenClaw)
- ✅ Private message support
- ✅ Group message support
- ✅ Access token authentication
- ✅ DM pairing/allowlist security
- ✅ CQ code support (images, faces, mentions, shares)

## Quick Start

### 1. Install dependencies

```bash
cd /app/extensions/go-cqhttp
pnpm install
```

### 2. Configure OpenClaw

Add to your OpenClaw config:

```json5
{
  channels: {
    "go-cqhttp": {
      accounts: {
        "default": {
          name: "QQ Bot",
          host: "0.0.0.0",  // In Docker, use 0.0.0.0
          port: 8080,
          accessToken: "your-secret-token", // optional but recommended
          dmPolicy: "pairing"
        }
      }
    }
  }
}
```

**Docker 用户注意:** 启动容器时映射端口:
```bash
docker run -d -p 8080:8080 openclaw-image
```

### 3. Configure go-cqhttp

In go-cqhttp's `config.yml`:

```yaml
servers:
  - ws-reverse:
      # If go-cqhttp runs on host (Linux):
      universal: ws://192.168.x.1:8080/ws?access_token=your-secret-token
      
      # If go-cqhttp runs on host (macOS/Windows):
      # universal: ws://host.docker.internal:8080/ws
      
      # If go-cqhttp runs in another container on same network:
      # universal: ws://openclaw:8080/ws
```

### 4. Start both services

```bash
# Start OpenClaw
openclaw gateway

# Start go-cqhttp
./go-cqhttp
```

## Project Structure

```
go-cqhttp/
├── openclaw.plugin.json  # Plugin manifest
├── package.json          # Dependencies
├── tsconfig.json         # TypeScript config
├── index.ts              # Plugin entry point
├── src/
│   ├── schema.ts         # Configuration schemas
│   ├── runtime.ts        # WebSocket server & API client
│   └── channel.ts        # OpenClaw channel implementation
```

## Development

```bash
# Build
pnpm build

# Watch mode
pnpm dev
```

## Documentation

Full documentation: https://docs.openclaw.ai/channels/go-cqhttp

## License

Same as OpenClaw
channels

Comments

Sign in to leave a comment

Loading comments...