NOW WORKING, made a new version of it, the bellow instructions are still up-to-date
Hi everyone, im Rui Oliveira (aka Hacklason/Hackerino), a newbie developer.
I wrote this PHP “API” that gets player’s data with r6tab API, filters the data for human readable text and forwards the results to Nightbot.
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 API.
This API will not save any data!
UPDATE: The source code is now public! (this is the V2) Click here to check out the repo
How to add commands to Nightbot
With chat:
!commands add !command_name command_response
or
!addcom !command_name command_response
With interface:
Check out nightbot’s interface.
Here’s what you need to add to a Nightbot command to get your R6 Rank (current season):
With name:
$(urlfetch https://ruioliveira.xyz/r6api/playerdata.php?p_name=YourR6NameHere&platform=YourPlatformHere®ion=YourRegionHere&command=rank)
With id:
$(urlfetch https://ruioliveira.xyz/r6api/playerdata.php?p_id=YourR6IdHere&platform=YourPlatformHere®ion=YourRegionHere&command=rank)
Full command example:
!commands add !r6rank $(urlfetch https://ruioliveira.xyz/r6api/playerdata.php?p_name=YourR6NameHere&platform=YourPlatformHere®ion=YourRegionHere&command=rank)
Output Example:
Region: EU | Rank: Gold IV | MMR: 2686 | Platform: UPLAY, Updated 21 hours ago, more info in https://r6tab.com/fbd7856f-2210-46a8-ae49-286aff3f2849
Output preview in twitch:
-
Adjust the URL parameters to fit your purposes.
-
?platform= (xbox, ps4 or uplay.)
xbox for Xbox One,
ps4 for PS4,
uplay for PC. -
®ion= (eu, na, as)
eu for Europe,
na for America,
as for Asia. -
&p_name=(Your nick on the specific platform)
or
&p_id=(Your player ID on the specific platform) -
Specify a command after the &command= query parameter at the end of the URL in the $(urlfetch) method.
rank for rank and mmr info,
stats for level, win rate and K/D (Ranked),
time for total playtime (Casual + Ranked).
Example of the commands outputs:
rank
Input example:
$(urlfetch https://ruioliveira.xyz/r6api/playerdata.php?p_name=Hacklason&platform=uplay®ion=eu&command=rank)
Output Example:
Region: EU | Rank: Gold IV | MMR: 2686 | Platform: UPLAY, Updated 21 hours ago, more info in https://r6tab.com/fbd7856f-2210-46a8-ae49-286aff3f2849
Output preview in twitch:
Check image above
stats
Input example:
$(urlfetch https://ruioliveira.xyz/r6api/playerdata.php?p_name=Hacklason&platform=uplay®ion=eu&command=stats)
Output Example:
Lv. 174 | 51.43% Win Rate | 1.06 K/D
Output preview in twitch:
time
Input example:
$(urlfetch https://ruioliveira.xyz/r6api/playerdata.php?p_name=Hacklason&platform=uplay®ion=eu&command=time)
Output Example:
510 hours, 13 minutes and 35 seconds
Output preview in twitch:
Want any new feature? Contact me in discord: Hackerino#0001