Skip to content

LiveAlerts

Domekologe edited this page Jul 2, 2026 · 1 revision

LiveAlerts

🌐 English · Deutsch

LiveAlerts posts Twitch live notifications and YouTube upload alerts into channels of your choice — with per-subscription message templates, optional role pings and configurable offline behaviour. Bilingual (DE/EN), opt-in per guild, with Web Dashboard integration. Author: pd-codes · requires Red 3.5.0+ · Status: Alpha 0.1.0.

Installation

[p]repo add PDC https://github.com/pd-codes/PDC_Redbot_Cogs
[p]cog install PDC livealerts
[p]load livealerts
[p]slash sync

Twitch API

Twitch alerts need app credentials, read from Red's shared API tokens (bot.get_shared_api_tokens("twitch") — both client_id and client_secret must be set):

[p]set api twitch client_id,<your_client_id> client_secret,<your_client_secret>

The cog fetches an app access token itself, caches it and refreshes it automatically. Without keys, Twitch subscriptions are skipped each cycle (status no_api). YouTube needs no API key — new uploads are detected via the public channel RSS feed.

Commands

All commands are under the hybrid group livealerts (alias la) and require admin or Manage Server.

Command What it does
livealerts enable <on/off> Enable/disable the module for this server.
livealerts addtwitch <login> <#channel> [template] Subscribe to a Twitch channel's live status (login from the channel URL).
livealerts addyoutube <channel_id> <#channel> [template] Subscribe to a YouTube channel's uploads (channel ID starts with UC…).
livealerts remove <id> Remove a subscription.
livealerts list List subscriptions with ID, target channel and status (paginated).
livealerts message <id> [template] Set the message template; omit to reset to default.
livealerts ping <id> [role] Set/remove a role to ping with each alert.
livealerts offline <id> <leave|edit|delete> What happens to a Twitch alert when the stream ends.
livealerts interval <seconds> Poll interval for this server (minimum 60 s).
livealerts language <de-DE|en-US> Output language for this server.

How it works

A background loop polls at the smallest configured guild interval (default 120 s, min 60 s, plus jitter; exponential backoff on errors). Twitch: all logins across guilds are checked in batches of up to 100 via the Helix streams API; a new stream ID triggers an alert (embed with title, game, viewers, thumbnail), and when the stream ends the configured offline mode marks the message as ended (edit), removes it (delete) or leaves it (leave). YouTube: the channel RSS feed is polled and unseen video IDs are announced (max 5 per cycle, oldest first; existing videos are seeded on add, so nothing old is spammed). Templates support the placeholders {streamer}, {title}, {url} and {game} (Twitch only).

Dashboard

Under Guild Settings: a Live alerts panel (Enabled, Interval, Language, plus a warning when Twitch API keys are missing), a Subscriptions table (type, name, channel, ping, status — edit name/channel/template/ping role/offline behaviour or delete) and an Add subscription panel (type, login/channel ID, channel, optional template). A separate guild page Live alert status shows a table of all subscriptions with status, live indicator and last fetch time.

Clone this wiki locally