A twitch bot for enabling quick user lookup of player ranks in chat using the public OBS API - docs available here
Note: If you wish to enable this functionality with Nightbot WarMachine
has advised this is configurable via nightbot with the following command
$(eval a = `$(urlfetch json https://cnc.community/api/leaderboard/tiberian-dawn/players/search?search=$(query))`; js = JSON.parse(a); `[CnC Ladder] Player Name: ${js[0].player_name} | Rank: ${js[0].rank} | Wins: ${js[0].wins} | Losses: ${js[0].losses} | Points: ${js[0].points}`)
You will need to register your own twitch bot to enable tmi.js to post to Twitch. Bots can be registered with Twitch here.
The bot requires the configuration of the following global variables:
USERNAME="your-registered-bot-name"
OAUTH="oauth:your-tmi-oauth-token"
CHANNEL="yourtwitchchannelname"
As dotenv
is enabled on the project all you need to do is create a file called .env
in the root of the project and copy and paste in the above variables with your own values.
TMI oauth token configuration can be obtained here https://twitchapps.com/tmi/
This project is written in JS and requires node and either npm or yarn to run. (if using npm replace commands below with npm
instead of yarn
)
Once you have node & either yarn or npm setup open a cmd terminal and run the following
// install dependencies
yarn install
// start bot
yarn start
Note: bot will only run so long as you have it running locally - this is currently not configured on a public server for permanent access.
Looking for extending functionality or have a question/issue with starting the bot? Feel free to open up an issue ticket here. I'll aim to get back to you as soon as I can.