Get a notification when somebody starts streaming a specific game on Twitch
- Clone the repo
- Copy
config.sample.phptoconfig.php - Right click the Discord channel you want notifications to appear in,
clickEdit Channel, go to theIntegrationstab and clickCreate Webhook:
- Click
Copy Webhook URLand you'll get a URL like
https://discord.com/api/webhooks/12345678987654321/hdKJHuiahwnejdjAKHUIhdkJAHWDiuawhdkJAHDuiawehkjA
which you have to stick into intoDISCORD_WEBHOOK_URLinconfig.php. - Use something like https://dev.twitch.tv/docs/api/reference#get-games to get the Game IDs on Twitch and stick them in
config.php - Create a Twitch Application and retrieve your Client ID and Client Secret; stick them into
config.php - Set
DISCORD_MESSAGE_PREFIXinconfig.phpto whatever you'd like prepended to the notification message.
For example if your Discord User ID is 1234567 you can use<@1234567>to notify yourself - Get the initial set of Twitch auth & refresh tokens:
- Automatically: Run
./setup.phpand follow the instructions. - Manually: Figure out how to get tokens and put them in the designated spots in
config.php
- Automatically: Run
Execute fetch.php, either directly in your terminal, or through a cronjob, or whatever floats your arbitrary precision arithmetics.
