Web app to list twitch buddies in order to find out who's streaming at anytime and allow to raid them easily.
https://protopotes.durss.ninja
npm install
Install PM2 globally (will run the script as a service) :
npm i -g pm2
Create a file data/credentials.json
on the projet's root folder and put this inside it with you twitch APP keys :
{
"client_id":"xxx",
"secret_id":"xxx",
"discordBot_token":"",
"privateApiKey":"",
"eventsub_secret":"",
"eventsub_callback":""
}
To get the client_id
and secret_id
keys, create a twitch app here:
https://dev.twitch.tv/console/apps
Configure an oauth redirect URI on the app so users can authenticate via Twitch from the page.
The URL should be your domain name ending with /oauth
, example:
http://locahost:8080/oauth
The privateApiKey
is just a key to secure an API exposed by the application itself. You probably won't care about it.
The discordBot_token
is a token to be defined if you want to control the app from discord.
See Create a discord bot
The eventsub_secret
and eventsub_callback
should be specified if you want to get discord alerts when a user goes live.
Leave these values blank if you don't need this feature.
The eventsub_secret
is a random string between 10 and 100 chars that'll be used to handshake with EventSub Twitch API. Write Anything you awant there.
The eventsub_callback
is the URI twitch will call when a user goes live. It will most probably be the domain name hosting the app.
When testing locally you'll want to use HTTPS tuneling like NGrok to get an HTTPS url that redirect queries to your localhost.
It is possible to add a bot to your discord that will control this app.
This allows to add/remove users and add/remove their description. It also comes with a bot that can send message to a chan everytime a user goes live on Twitch.
First, create an app here:
https://discord.com/developers/applications/
Once the app is created, create a bot within the app.
Get its token
and set it as the discordBot_token
value on the file data/credentials.json
.
To add the bot to your discord, find the client ID
on OAuth section of the discord APP, update the following URL and open it on your browser:
https://discordapp.com/oauth2/authorize?scope=bot&client_id=CLIENT_ID
Once done, the administrator of the discord needs to send this command on the channel(s) that should be listened by the bot:
!raider-add
Then you should be good to go!.
You can list all the available commands with this command:
!raider-help
npm run front/serve
npm run front/build
npm run server/watch
npm run server/build
npm run dev
Starts front and server with hot reload.
Node process has to be started manually. See Starting services section.
npm run build
Execute this inside project folder's root
pm2 start bootstrap-pm2.json
To view process logs via PM2, execute :
pm2 logs --raw StreamerRaider
DOESN'T work on windows
First start the client as explained above.
Then execute these commands:
pm2 save
pm2 startup
Now, the service should automatically start on boot