This repo template sets up a scheduled task that checks if a Twitch channel is live or not. If the status has changed since the last check, it sends a Discord notification.
The speed of the notification depends on GitHub's global system load. It's configured to run every minute, but the quickest GitHub runs tasks is every five minutes. If there's a lot of tasks in GitHub's systems at the moment, it may take significantly more between checks.
- Create a repository from this template by clicking the green
Use this template
button - Go to the Twitch developer console and
create a new application. Use
http://localhost
for the redirect URI. - Once created, click
Manage
next to the new application, and copy the client ID. - On a new tab, go to your repository and click
Settings
>Security
>Secrets
>Actions
- Click
New repository secret
, then typeCLIENT_ID
in the Name field. Paste the copied string from step 3 into the value field, then clickAdd secret
. - Back in the Twitch developer console, click
New secret
, then copy the resulting value. - On GitHub, click
New repository secret
, then typeCLIENT_SECRET
into the Name field. Paste the copied value from step 6 into the value field, then clickAdd secret
. - Like before, add a new secret named
CHANNEL
, and type the name of the channel you want to get pings for into the value field, then clickAdd secret
. - Create a webhook in your Discord server on the channel you want the pings to show up in. Copy the webhook.
- Add the last, 4th secret named
DISCORD_WEBHOOK
, and paste the value of the webhook you copied from Discord during step 9 into the value field. - Done! Your webhook will be triggered when the channel goes live, or goes offline. You can also manually trigger the check by going to
Actions
>check
and clickingRun workflow