CS:GO custom APIs


#23

Nice idea!
Added the command and updated the docs at https://csgo-stats.net/tools/nightbot

Thank you for the feedback :slight_smile:


#24

Looking for a better example of how to use the !rank command.
$(urlfetch https://csgo-stats.net/api/nightbot/rank/$(demnd)/YOURCUSTOMURL)
the bold part is where I am confused, is that my steam url like http://steamcommunity.com/profiles/76561198149238583/ ,or is it the csgo-stats.net url for my profile?

Sorry for the super late question, but I can’t find any other examples elsewhere unfortunately.


#25

How do I remove the link in the response? there is a maximum of 400 characters, and I want to add several fetchurl in the same command


#26

You can use Nightbot’s eval variable to remove the link.

Stats for a specific user
!stats

$(eval `$(urlfetch https://csgo-stats.net/api/nightbot/stats/$(channel)/YOURCUSTOMURL)`.replace(/ - .*/, ""))

Your watchers stats
!mystats [CUSTOMURL]

$(eval `$(urlfetch https://csgo-stats.net/api/nightbot/stats/$(channel)/$(1))`.replace(/ - .*/, ""))

Show your current inventory
!inventory

$(eval `$(urlfetch https://csgo-stats.net/api/nightbot/inventory/$(channel)/YOURCUSTOMURL)`.replace(/ - .*/, ""))

Your always up-to-date rank
!rank

$(eval `$(urlfetch https://csgo-stats.net/api/nightbot/rank/$(channel)/YOURCUSTOMURL)`.replace(/ - .*/, ""))

VAC status
!vac [steamname]

$(eval `$(urlfetch https://vac-check.com/api/$(channel)/$(1))`.replace(/ - .*/, ""))


#27

Cool! Now I don’t have to worry about the link being posted several times in the same response Thanks! :smiley:


#28

Thank you for the feedback.