docs: add IRC commands/plugin setup to README, update WebSocket docs

README was missing IRC command reference, plugin installation/config
guidance, and referenced nonexistent plugin READMEs. The WebSocket
docs in api.md were stale — subscribe message now documents role and
client_id fields, status message now includes the clients array.

Made-with: Cursor
This commit is contained in:
cottongin
2026-03-12 08:26:16 -04:00
parent 911dd3d5dd
commit 0f99e7914b
2 changed files with 82 additions and 4 deletions

View File

@@ -412,23 +412,52 @@ WebSocket endpoint for receiving announce broadcasts. Used by IRC bot plugins.
After connecting, send a subscribe message:
```json
{"type": "subscribe", "token": "<NTR_ADMIN_TOKEN>"}
{
"type": "subscribe",
"token": "<NTR_ADMIN_TOKEN>",
"role": "bot",
"client_id": "limnoria"
}
```
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `type` | string | yes | Must be `"subscribe"` |
| `token` | string | yes | `NTR_ADMIN_TOKEN` value |
| `role` | string | no | Client role, defaults to `"bot"` |
| `client_id` | string | no | Identifier for this client (e.g. `"sopel"`, `"limnoria"`) |
Invalid token closes the connection with code `4001`.
**Messages from server**
Announce broadcast:
```json
{"type": "announce", "message": "Now Playing: Song #1: Title by Artist - URL"}
```
Status update (sent on subscriber connect/disconnect):
```json
{"type": "status", "subscribers": 2}
{
"type": "status",
"subscribers": 2,
"clients": [
{
"client_id": "limnoria",
"remote_addr": "1.2.3.4",
"connected_at": "2026-03-12T02:00:00+00:00"
}
]
}
```
| Field | Type | Description |
|-------|------|-------------|
| `subscribers` | integer | Number of connected bot clients |
| `clients` | array | List of connected bot clients with their `client_id`, `remote_addr`, and `connected_at` timestamp |
---
## Dashboard Configuration