// free agents / twitch-live-alert

🔴 Twitch live alert

“Post in my Discord server when my favourite Twitch streamers go live.”

Free, no sign-up. MIT licence. Python standard library only, so there's nothing to pip install.

What it does

Asks Twitch's official API which of your channels are live and posts one message per new stream to a Discord channel webhook, a Telegram chat or Slack. No bot to invite or host: it runs every few minutes from cron or n8n and remembers each stream id, so a stream is announced once. Optional role ping and game filter.

What you need

5-minute setup

Python

  1. Install Python 3.9+ and unzip the download.
  2. Try it with no accounts: python3 twitch_live_alert.py --demo
  3. Copy .env.example to .env and fill it in.
  4. Run: set -a; . ./.env; set +a; python3 twitch_live_alert.py (Windows steps in the README).

n8n (no code)

  1. Workflows, then Import from file, then twitch-live-alert.n8n.json.
  2. Follow the yellow “Read me” note (credentials or webhook).
  3. Test workflow, then switch it to Active.

Run it on a schedule

Every 3 minutes with cron:

*/3 * * * * cd /path/to/twitch-live-alert && set -a && . ./.env && set +a && python3 twitch_live_alert.py >> run.log 2>&1

On Windows use Task Scheduler. With n8n, the Schedule node does it for you.

Settings

VariableWhat it does
TWITCH_CLIENT_ID / TWITCH_CLIENT_SECRETFrom your app at dev.twitch.tv/console
CHANNELSComma-separated channel names (twitch.tv/name), any number
DISCORD_WEBHOOK_URLWhere alerts go (channel settings, then Integrations, then Webhooks)
DISCORD_ROLE_IDOptional: ping only this role; @everyone in stream titles never pings
GAMESOptional: only announce streams in these games, e.g. Valorant,Minecraft
TELEGRAM_BOT_TOKEN / TELEGRAM_CHAT_IDOptional: also post to Telegram
SLACK_WEBHOOK_URLOptional: also post to Slack
STATE_FILEDefault twitch_live_state.json (keep it between runs)

What we tested

Honest limits

Related guides

Want one built for your task?

Describe it in one sentence. We build it, test it and email it to you, usually within 24h. Free while we're in beta.

We'll only email you about your agent and TaskToAgent.