feat: persist alert results to SQLite history table
Matched results were announced then discarded. Add a dedicated SQLite database (data/alert_history.db) to store every announced result with channel, alert name, backend, title, URL, date, and timestamp. Add !alert history <name> [n] subcommand to query recent results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -341,13 +341,14 @@ No API credentials needed (uses public GQL endpoint).
|
||||
!alert del <name> # Remove alert (admin)
|
||||
!alert list # List alerts
|
||||
!alert check <name> # Force-poll now
|
||||
!alert history <name> [n] # Show recent results (default 5)
|
||||
```
|
||||
|
||||
Searches keywords across YouTube (InnerTube), Twitch (GQL), and SearXNG simultaneously.
|
||||
Names: lowercase alphanumeric + hyphens, 1-20 chars. Keywords: 1-100 chars.
|
||||
Max 20 alerts/channel. Polls every 5min. Max 5 announcements per platform per cycle.
|
||||
Format: `[name/yt] Title -- URL`, `[name/tw] Title -- URL`, or `[name/sx] Title -- URL`.
|
||||
No API credentials needed. Persists across restarts.
|
||||
No API credentials needed. Persists across restarts. History stored in `data/alert_history.db`.
|
||||
|
||||
## SearX
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ format = "text" # Log format: "text" (default) or "json"
|
||||
| `!username <user>` | Check username across ~25 services |
|
||||
| `!username <user> <service>` | Check single service |
|
||||
| `!username list` | Show available services by category |
|
||||
| `!alert <add\|del\|list\|check\|history>` | Keyword alert subscriptions across platforms |
|
||||
| `!searx <query>` | Search SearXNG and show top results |
|
||||
|
||||
### Command Shorthand
|
||||
@@ -666,6 +667,7 @@ simultaneously.
|
||||
!alert del <name> Remove alert (admin)
|
||||
!alert list List alerts
|
||||
!alert check <name> Force-poll now
|
||||
!alert history <name> [n] Show recent results (default 5, max 20)
|
||||
```
|
||||
|
||||
- `add` and `del` require admin privileges
|
||||
@@ -692,5 +694,7 @@ Polling and announcements:
|
||||
- Each platform maintains its own seen list (capped at 200 per platform)
|
||||
- 5 consecutive errors doubles the poll interval (max 1 hour)
|
||||
- Subscriptions persist across bot restarts via `bot.state`
|
||||
- Matched results are stored in `data/alert_history.db` (SQLite)
|
||||
- `list` shows error status indicators next to each alert
|
||||
- `check` forces an immediate poll across all platforms
|
||||
- `history` queries stored results, most recent first
|
||||
|
||||
Reference in New Issue
Block a user