28 lines
945 B
Markdown
28 lines
945 B
Markdown
# Discord Bot
|
|
|
|
Receives webhooks from the cache service and posts door status updates to a Discord channel as embeds.
|
|
|
|
- Green embed = door open
|
|
- Red embed = door closed
|
|
- Gray embed = Pi offline
|
|
|
|
Validates inbound webhooks with a Bearer token. Maintains a persistent Discord gateway connection with automatic reconnection.
|
|
|
|
## API
|
|
|
|
| Method | Path | Auth | Description |
|
|
|--------|------|------|-------------|
|
|
| `POST` | `/webhook` | Bearer | Status update from the cache service |
|
|
| `GET` | `/health` | — | Health check |
|
|
|
|
## Configuration
|
|
|
|
NixOS options under `services.noisebell-discord`:
|
|
|
|
| Option | Default | Description |
|
|
|--------|---------|-------------|
|
|
| `domain` | required | Caddy virtual host domain |
|
|
| `discordTokenFile` | required | Discord bot token file |
|
|
| `channelId` | required | Discord channel ID to post to |
|
|
| `webhookSecretFile` | required | Shared secret with the cache service |
|
|
| `port` | `3001` | Listen port |
|