Warzone custom API command

:warning: The API blocked requests from Nightbot, the command is dead. :warning:

Hey @xkajonx!

Not sure what your first question is about? You add this command to Nightbot yourself, it goes into custom commands.

To your second question, yes, it’s possible, however people will have to give their PLATFORM and USERNAME as the website formats it, so let’s say your username is ABCD but you also have a discriminator (numbers after the name), and you play on PlayStation, then you’d have to type psn ABCD#1234 after the command.

The possible values for the platform are:
• PlayStation Network: psn
• Activision ID: atvi
• Battle.⁣net: battlenet
• Xbox Live: xbl

You will also need to use 2 commands, one of which will be an alias called by the first command, so let’s say you call your command !stats, I recommend calling the alias _stats. If you add the commands from the dashboard, make sure to add _stats in the alias field of !stats, if you add the commands from the chat go like this:
!addcom !stats -a=_stats COMMAND_CODE
!addcom _stats COMMAND_CODE

Below are the commands in order, so you have the alias in second:

$(eval `$(querystring)`.toLowerCase().replace(`%20`,`/`))

$(eval s=$(urlfetch json https://api.tracker.gg/api/v2/warzone/standard/profile/$(query)).data.segments[0].stats; r=s.kdRatio.value; k=s.kills.value; d=s.deaths.value; w=s.wins.value; `Wins: ${w} | Kills: ${k} | Deaths: ${d} | Kills/Deaths Ratio: ${r}`)
1 Like