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.
"!commands add !command_name command_response"
"!addcom !command_name command_response"
Here’s what the response should contain for Nightbot to reply with your current 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.
- 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!
You can let the user search for a player themself by doing ?platform=$(1)&nick=$(2).
The user will have to put the platform and a nick as arguments separated by a space after your command.
List of commands you can specify after the &command= query parameter:
Example output: "Platinum Ⅰ - matchmaking rating: 4465 「35 ᴍᴍʀ left for a rank promotion to Diamond ★ 」"
You can specify ®ion= (NA, EU or ASIA) if you play on multiple regions with one account!
Use ®ion=$(1) to allow viewers to input a region as second argument.
Example output: “Lv.115 | 1.7 W/L ratio | 1.1 K/D ratio”
(Only ranked resources are used to calculate these values.)
Example output: “238h 38m 24s”
(time spent in multiplayer, ie. ranked + casual.)
If there is demand for other commands ie. statistics I will add more.
Problem: Unable to fetch resources using gamer tags with spaces in the ‘nick=’ query parameter.
Solution: Use the login nick you created your account with instead. (ie. your first nick ever.)
Solution 2: Use your profileId which you can get from your profile URL at https://game-rainbow6.ubi.com/