← Back to Plugins
Channels

Go Cqhttp

Fizzzli By Fizzzli 👁 76 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...