← Back to Plugins
Channels

Plugin Stoat

robbyczgw-cla By robbyczgw-cla 👁 261 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...