Hey RB6: Siege Twitch streamers, I wrote a PHP script that uses the API statistics and gathers end-points of the rainbow6 profile page and forwards them to Nightbot. I deployed it on Heroku and it is ready to use by everyone!
This server-side script is making use of Nightbot's dynamic response system (mostly $(urlfetch)) with which you are able to fetch the resources forwarded by my Heroku App.
Do not worry! Nothing is saved server-side.
This privat "API" is purely for “viewing” ressources!
How to add commands to Nightbot.
With chat:
"!commands add !command_name command_response"
or
"!addcom !command_name command_response"
With interface:
https://beta.nightbot.tv/commands/custom
Here's what the response should contain for Nightbot to reply with your current rank:
$(urlfetch http://rainbowsix7nightbot.herokuapp.com/rainbowsix7.php?platform=YourPlatformHere&nick=YourNickHere&command=rank)
- Adjust the URL parameters to fit your purposes.
- ?platform= (xbl, psn or uplay.)
xbl for Xbox One,
psn for PS4,
uplay for PC.
- &nick= (Your nick on the specific platform OR your profile ID.)
- Specify a command after the &command= query parameter at the end of the URL in the $(urlfetch) method.
In the example above I specified "rank" as for the current rank in the current season.
Note:
- You CAN write custom text before and after $(urlfetch) in the response!
- Do NOT forget to close any opening parantheses '(' with a closing ')' at the end!
