A timer for an "Everythingathon" for streaming platform Twitch. The stream lasts as long as the timer does not hit 0, and different events adds more time to the timer. An Everythingathon is similar to a Subathon, but in a Subathon only subscriptions add time to the timer, whereas in an Everythingathon other events add time too (following, cheering bits, donating, raiding).
- Head to Twitch Developer Console Portal and log in with your Twitch details.
- Create an application by clicking
Register Your Application
from theDashboard
page. - Give the application a name and select
Chat Bot
as the category. - For the OAuth Redirect URL, enter
https://twitchapps.com/tokengen/
- Click
Create
to finish creating the Twitch application.
- Download Node.js using the installer on their website.
- Download the source code for Everythingathon-Twitch.
- Extract the files into a single folder.
- Open a command prompt window in this directory (Shift + Right Click in the folder is an easy way to do this), and then type
npm install
.
- Open the
.env
file, in the Everythingathon-Twitch directory, in a text editor. - To get
TMI_PASSWORD
:
- Go to this website and click
Connect
. - Copy the provided OAuth password (e.g.
oauth:c6ababco2v8120abcd5ei3f315g5h
) and paste it in the speech marks forTMI_PASSWORD
in the.env
file.
- To get
CLIENT_ID
:
- Go to the Twitch Developer Console Portal, find your Application, and click
Manage
. - Copy the value for
Client ID
(e.g.ab5cd4efghij355kl6m1nop4q7038r
) and paste it in the speech marks forCLIENT_ID
in the.env
file.
- To get
ACCESS_TOKEN
:
- Go to this website and paste the Client ID you have previously found (step 3) in the appropriate input box.
- In the scopes input box, enter:
moderator:read:followers bits:read channel:read:subscriptions channel:read:redemptions channel:manage:redemptions
(make sure they are separated by spaces as shown). - Click connect, and then copy the provided Access Token (e.g.
a2bcd5efg1hijklmn3o2pqrstu2v2w
) into the speech marks forACCESS_TOKEN
in the.env
file.
- To get
SOCKET_TOKEN
:
- Go to Streamlabs API Settings page and then click on
API Tokens
. - Copy the Socket API Token (it is very long, so no example given) and paste it in the speech marks for
SOCKET_TOKEN
in the.env
file.
- You can set the time at which the timer will start at by inputting the time in seconds in the
time.txt
file.- e.g. if you want the timer to start at 10 hours, you would put set the value in
time.txt
to 36000, as there are 36000 seconds in 10 hours.
- e.g. if you want the timer to start at 10 hours, you would put set the value in
- Open
index.js
and set the constantchannelToMonitor
equal to the name of the channel for the Everythingathon (caps do not matter).- e.g. set
channelToMonitor = 'louieej'
if the Twitch channel for this Everythingathon is LouieEj.
- e.g. set
- The time which gets added to the timer, in seconds, can be configured at the top of
index.js
.- IMPORTANT: Make sure all values are in seconds, e.g. 10 minutes should be the value 600.
- You can also specify the minimum Streamlabs donation amount which will add time to the timer; by default it is set to 0, which means any Streamlabs donation amount will add time.
- Open OBS and create a new browser source.
-
- Tick
Local File
and then navigate to the Everythingathon-Twitch directory, and choose theindex.html
file. - Set the width to 600 and the height to 180. Click OK.
- Tick
- The timer should now display the time.
- NOTE: If the timer ever hits 0, the timer will stay at 0, even if the value in
time.txt
increases.- To force the timer to update in a situation like this, right click the Browser source, click
Properties
, scroll down and clickRefresh cache of current page
.
- To force the timer to update in a situation like this, right click the Browser source, click
- Just before starting a proper Everythingathon, the followersID.csv file should be updated.
- To do this, delete the existing one, and then head to this website.
- Enter the name of the channel which the Everythingathon is happening on, and then wait for the followers list to be generated.
- Once the button shows, click on
Export all as CSV
.
- Once downloaded, open the CSV file in Microsoft Excel (or a similar program) and delete all the rows other than the
userID
row. - Save the file in the Everythingathon-Twitch directory, and rename the file to
followersID.csv
.- If, for whatever reason, you cannot name the file this, call it something else and then update the constant
followersIDCSV
inindex.js
accordingly.
- If, for whatever reason, you cannot name the file this, call it something else and then update the constant
- When running the bot for an actual Everythingathon, and not for testing, you should set the value for
DEBUG_MODE
near the top ofindex.js
to false. - Go to the directory of the timer and open a command prompt/terminal window.
- Type
node index.js
and the timer should start running. - If you ever need to stop the timer, you can press Control + C in the terminal window.