Welcome to the DevWars Bot codebase. This bot is responsible for many interactions during a live game, such as: betting, voting, earning coins, etc.
DevWars.tv is a live game show for developers that is currently streamed on Twitch. People of all levels participate in an exhilarating battle to create the best website they can within 60 minutes. Teams are formed of 3 people, with the team's members each controlling a single language - HTML, CSS and JavaScript.
- Nodejs: 14.5.x
- Twitch: Account username and oauth
- (optional) DevWars API: Run DevWars API locally to test endpoints the bot hits
Run npm run install
to install dependent node_modules.
Make a copy of the .env.example
file in the same directory and rename the given file to .env
. This will be loaded up into the application when it first starts running. These are required configuration settings to ensure correct function. Process through the newly created file and make the required changes if needed.
Twitch Config
Make a copy of the twitch.config.example.json
file and rename the given file to twitch.config.json
. This will be loaded and maintained by the Twitch service, used to communicate to the api. Using a JSON file will allow the automatic updating/refreshing of the access token when it expires.
To obtain the initial accessToken
and refreshToken
:
- Register Your Application here
- oAuth Redirect Url =
http://localhost
- Category =
Chat Bot
- oAuth Redirect Url =
- Get
Code
with
GET https://id.twitch.tv/oauth2/authorize
--data-urlencode
?client_id=<your client ID>
&redirect_uri=<your redirect URI>
&response_type=code&scope=moderator:read:chatters
- Get
accessToken
andrefreshToken
POST https://id.twitch.tv/oauth2/token
?client_id=<your client ID>
&client_secret=<your client secret>
&code=<authorization code received above>
&grant_type=authorization_code
&redirect_uri=<your redirect URI>
Running npm run test
will start the testing process.
Running npm start
will run the bot
You can check out the full license here
This project is licensed under the terms of the MIT license.