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:
53
README.md
53
README.md
@@ -78,8 +78,57 @@ Enable by setting these environment variables:
|
||||
| `NTR_WEB_PASSWORD` | *(required)* | Dashboard login password |
|
||||
| `NTR_SECRET_KEY` | *(required)* | Secret key for cookie signing |
|
||||
|
||||
Bot plugins (Sopel and Limnoria) connect to the API's WebSocket endpoint
|
||||
to receive announcements. See plugin READMEs for configuration.
|
||||
## IRC Commands
|
||||
|
||||
Both Sopel and Limnoria plugins expose the same commands:
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `!1`, `!2`, ... `!N` | Track by position in the current week's playlist |
|
||||
| `!song <episode> <position>` | Track from a specific episode's playlist |
|
||||
| `!playlist [episode]` | Current week's playlist, or a specific episode |
|
||||
| `!lastshow <position>` | Track from the previous week's show |
|
||||
| `!status` | API health, poller status, and track count |
|
||||
| `!refresh` | Trigger a manual SoundCloud fetch (admin only) |
|
||||
|
||||
## IRC Plugin Setup
|
||||
|
||||
Both plugins require the `websocket-client` package for live announcements:
|
||||
|
||||
```bash
|
||||
pip install websocket-client
|
||||
```
|
||||
|
||||
### Sopel
|
||||
|
||||
Copy `plugins/sopel/ntr_playlist.py` into your Sopel plugins directory
|
||||
(typically `~/.sopel/plugins/`). Add a `[ntr_playlist]` section to your
|
||||
Sopel config:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---------|---------|-------------|
|
||||
| `api_base_url` | `http://127.0.0.1:8000` | NtR API base URL |
|
||||
| `admin_token` | *(empty)* | Bearer token for admin commands |
|
||||
| `admin_nicks` | *(empty)* | Comma-separated list of admin nicknames |
|
||||
| `display_timezone` | `America/New_York` | Timezone for displayed timestamps |
|
||||
| `ws_url` | `ws://127.0.0.1:8000/ws/announce` | WebSocket endpoint for announcements |
|
||||
| `announce_channel` | `#sewerchat` | Channel to send announcements to |
|
||||
| `client_id` | `sopel` | Identifier for this bot in status messages |
|
||||
|
||||
### Limnoria
|
||||
|
||||
Copy the `plugins/limnoria/NtrPlaylist/` directory into your Limnoria bot's
|
||||
plugins folder. Configure via the Limnoria registry:
|
||||
|
||||
| Registry Value | Default | Description |
|
||||
|----------------|---------|-------------|
|
||||
| `apiBaseUrl` | `http://127.0.0.1:8000` | NtR API base URL |
|
||||
| `adminToken` | *(empty)* | Bearer token for admin commands |
|
||||
| `adminNicks` | *(empty)* | Space-separated list of admin nicknames |
|
||||
| `displayTimezone` | `America/New_York` | Timezone for displayed timestamps |
|
||||
| `wsUrl` | `ws://127.0.0.1:8000/ws/announce` | WebSocket endpoint for announcements |
|
||||
| `announceChannel` | `#sewerchat` | Channel to send announcements to |
|
||||
| `clientId` | `limnoria` | Identifier for this bot in status messages |
|
||||
|
||||
## Development
|
||||
|
||||
|
||||
Reference in New Issue
Block a user