diff --git a/docs/CHEATSHEET.md b/docs/CHEATSHEET.md index eb546b1..7459169 100644 --- a/docs/CHEATSHEET.md +++ b/docs/CHEATSHEET.md @@ -316,6 +316,19 @@ Accepts any YouTube URL: video, channel, handle, shorts, embed. Names: lowercase alphanumeric + hyphens, 1-20 chars. Max 20 channels/channel. Polls every 10min. Announces max 5 new videos per cycle. Persists across restarts. +## Twitch + +``` +!twitch follow [name] # Follow streamer (admin) +!twitch unfollow # Unfollow streamer (admin) +!twitch list # List followed streamers +!twitch check # Force-poll now +``` + +Names: lowercase alphanumeric + hyphens, 1-20 chars. Max 20 streamers/channel. +Polls every 2min. Announces offline->live transitions. Persists across restarts. +No API credentials needed (uses public GQL endpoint). + ## Plugin Template ```python diff --git a/docs/USAGE.md b/docs/USAGE.md index ad79447..17165fc 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -598,3 +598,34 @@ Polling and announcements: - Supports HTTP conditional requests (`ETag`, `If-Modified-Since`) - 5 consecutive errors doubles the poll interval (max 1 hour) - Subscriptions persist across bot restarts via `bot.state` + +### `!twitch` -- Twitch Livestream Notifications + +Follow Twitch streamers and get notified when they go live. Uses Twitch's +public GQL endpoint (no API credentials required). + +``` +!twitch follow [name] Follow a streamer (admin) +!twitch unfollow Unfollow a streamer (admin) +!twitch list List followed streamers +!twitch check Check status now +``` + +- `follow` and `unfollow` require admin privileges +- All subcommands must be used in a channel (not PM) +- If `name` is omitted on `follow`, it defaults to the Twitch login (lowercase) +- Names must be lowercase alphanumeric + hyphens, 1-20 characters +- Twitch usernames must match `[a-zA-Z0-9_]{1,25}` +- Maximum 20 streamers per IRC channel + +Polling and announcements: + +- Streamers are polled every 2 minutes by default +- On `follow`, the current stream state is recorded without announcing +- Announcements fire on state transitions: offline to live, or new stream ID +- Format: `[name] is live: Stream Title (Game) -- https://twitch.tv/login` +- Game is omitted if not set; titles are truncated to 80 characters +- 5 consecutive errors doubles the poll interval (max 1 hour) +- Subscriptions persist across bot restarts via `bot.state` +- `list` shows live/error status indicators next to each streamer +- `check` forces an immediate poll and reports current status