← Back to Plugins
Channels

Plugin Stoat

robbyczgw-cla By robbyczgw-cla 👁 4 views ▲ 0 votes

🦎 Stoat (Revolt) channel plugin for OpenClaw β€” WebSocket + REST hybrid with image support

GitHub

Configuration Example

{
  "channels": {
    "stoat": {
      "enabled": true,
      "token": "YOUR_BOT_TOKEN",
      "wsBase": "wss://events.stoat.chat"
    }
  },
  "plugins": {
    "entries": {
      "stoat": {
        "enabled": true
      }
    }
  }
}

README

# 🦎 openclaw-plugin-stoat

> **The first Revolt/Stoat channel plugin for [OpenClaw](https://github.com/openclaw/openclaw)**

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![OpenClaw](https://img.shields.io/badge/OpenClaw-Plugin-blue)](https://github.com/openclaw/openclaw)

Connect your OpenClaw agent to [Revolt](https://revolt.chat) / [Stoat](https://stoat.chat) servers with full bidirectional messaging, image support, and rock-solid connectivity.

## ✨ Features

- **πŸ”Œ WebSocket Primary** β€” Real-time message delivery via Revolt's WebSocket API
- **πŸ”„ REST Polling Fallback** β€” Automatic 10s polling when WebSocket disconnects
- **πŸ–ΌοΈ Image Support** β€” Inbound + outbound attachments via Revolt's Autumn file server
- **⌨️ Typing Indicators** β€” Shows typing status before bot replies
- **πŸ’¬ DM Support** β€” Direct messages and saved messages detection
- **πŸ” Auto-Reconnect** β€” Exponential backoff (max 120s) with automatic recovery
- **πŸ’“ Ping Keepalive** β€” Proactive 30s pings to prevent server-side disconnects
- **πŸ€– Self-Message Filtering** β€” Bot won't respond to its own messages
- **πŸ‘₯ Multi-Account** β€” Support for multiple bot accounts

## πŸ“¦ Installation

1. Copy the plugin to your OpenClaw extensions directory:

```bash
mkdir -p ~/.openclaw/extensions/stoat
cp index.js package.json ~/.openclaw/extensions/stoat/
```

2. Add to your OpenClaw config (`~/.openclaw/openclaw.json`):

```json
{
  "channels": {
    "stoat": {
      "enabled": true,
      "token": "YOUR_BOT_TOKEN",
      "wsBase": "wss://events.stoat.chat"
    }
  },
  "plugins": {
    "entries": {
      "stoat": {
        "enabled": true
      }
    }
  }
}
```

3. Restart OpenClaw:

```bash
systemctl --user restart openclaw-gateway
```

## πŸ”§ Configuration

| Key | Default | Description |
|-----|---------|-------------|
| `channels.stoat.token` | β€” | Bot token from Revolt/Stoat |
| `channels.stoat.wsBase` | `wss://events.stoat.chat` | WebSocket endpoint |
| `channels.stoat.apiBase` | `https://api.revolt.chat` | REST API endpoint |
| `channels.stoat.autumnBase` | `https://autumn.revolt.chat` | File upload server |
| `channels.stoat.pollChannels` | `[]` | Channel IDs for REST polling fallback |

### Environment Variables

You can also set the token via environment variable:

```bash
export STOAT_BOT_TOKEN="your-bot-token"
```

## 🏠 Self-Hosted Revolt

Works with self-hosted Revolt instances β€” all endpoints are fully configurable:

```json
{
  "channels": {
    "stoat": {
      "token": "YOUR_BOT_TOKEN",
      "apiBase": "https://your-revolt.example.com/api",
      "wsBase": "wss://your-revolt.example.com/ws",
      "autumnBase": "https://your-revolt.example.com/autumn"
    }
  }
}
```

No hardcoded URLs β€” point it at any Revolt-compatible server.

## πŸ—οΈ Architecture

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     WebSocket      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Revolt/     │◄──────────────────►│   OpenClaw    β”‚
β”‚  Stoat       β”‚     (primary)      β”‚   Gateway     β”‚
β”‚  Server      │◄──────────────────►│              β”‚
β”‚              β”‚   REST API          β”‚              β”‚
β”‚              β”‚   (fallback)        β”‚              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                                   β”‚
       β”‚  Autumn                           β”‚
       β”‚  (file uploads)                   β”‚
       β–Ό                                   β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Attachments β”‚                    β”‚  Agent       β”‚
β”‚  (images)    β”‚                    β”‚  Response    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

**Hybrid Connectivity:**
1. WebSocket connects and authenticates with bot token
2. On disconnect β†’ automatic REST polling every 10s
3. On WebSocket reconnect β†’ polling stops
4. Proactive ping every 30s prevents server-side timeouts

## πŸ”’ Security

- Bot token is never logged or exposed in status endpoints
- Self-message filtering prevents infinite loops
- Rate limiting (429) handled with automatic backoff
- No message content is logged
- See [SECURITY-AUDIT.md](SECURITY-AUDIT.md) for full audit

## πŸ“ Creating a Bot

1. Go to your Revolt/Stoat server settings
2. Navigate to **Bots** β†’ **Create Bot**
3. Copy the bot token
4. Invite the bot to your server/channels

## 🀝 Contributing

PRs welcome! This is the first Revolt/Stoat plugin for OpenClaw.

## πŸ“„ License

[MIT](LICENSE) Β© 2026 robbyczgw-cla
channels

Comments

Sign in to leave a comment

Loading comments...