Twitch livestream notifications in Discord using webhooks
- Set environment variables:
- Replace
your_twitch_client_idandyour_twitch_client_secretwith your Twitch client ID and secret from the Twitch developer console.
- Replace
TWITCH_CLIENT_ID=your_twitch_client_id
TWITCH_CLIENT_SECRET=your_twitch_client_secret- Write streamer configuration in
data/streamers.yaml. Specify multiple streamers by adding additional dictionary entries.- Replace
twitch_usernamewith the lower case Twitch username you want to monitor. - Replace
discord_webhook_urlwith a webhook URL for the channel to post the webhook. - Replace
role_idwith the id of the role to ping. Alternatively you could ping a user or remove the mention entirely.
- Replace
twitch_username:
webhook_url: "discord_webhook_url"
now_live_message: "<@&role_id> Stream is live!!"
was_live_message: "Stream was live.."version: '3'
services:
streamhook:
image: ghcr.io/njallam/streamhook
container_name: streamhook
restart: unless-stopped
volumes:
- "./streamhook:/app/data" # Create streamers.yaml as above
environment:
- TWITCH_CLIENT_ID=your_twitch_client_id
- TWITCH_CLIENT_SECRET=your_twitch_client_secret