Hello, My friend is using nightbot for some simple commands. !gulagw which counts up the amount of times he won the gulag. Also !gulagl which counts up the amount of times he lost the gulag. I am looking to make a command !gulag which shows both the counters and am not quite sure how to make it thanks!
Gulag Counter Command
8 replies
This is possible using the following 3 commands all credit goes to @member for the commands and @member for the API:
This is possible using ehsankia’s quote custom API - read more about it here .
Click this link . It will generate three links and two tokens, a public token (8 characters long) and a private token (16 characters long). The public token is located within the first generated link. The private token is located within both the second and third generated links. The tokens are found after token= and before &data=$(querystring) Copy them and keep them somewhere safe !
!addwin which adds a win to the running score (mod-only)
!addkill which adds a kill to the running score (mod-only)
!score which displays the numbers of wins and kills
Either copy and paste these commands into chat or add them through the Nightbot dashboard . Add the commands through chat only if you are sure no one else is there, otherwise they might see your private token (which is used to edit the list)! Replace PUBLIC_TOKEN with your public token and PRIVATE_TOKEN with your private token.
!addcom -ul=mod !gulagw $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=win)`;` `) $(channel) just won a gulag!!addcom -ul=mod !gulagl $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=loss)`;` `) $(channel) just lost a gulag!
!addcom -cd=5 !gulag $(eval a=`$(urlfetch json http://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)`;w=a.match(/win/g)!=null?a.match(/win/g).length:0;k=a.match(/loss/g)!=null?a.match(/loss/g).length:0;`$(channel) has ${w} wins and ${k} loss.`)
Feel free to change the responses of !gulagw and !gulagl just as long as the $(eval) variables remain untouched!
Yes but it resets them both:
!addcom -ul=mod !gulagreset $(eval a=`$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&clear=1)`;` `) $(user) has cleared the score!
I would even suggest making the userlevel owner as to avoid any accidents. As it is set to mod just change the mod after -ul= to owner if you want to change it.
Didn't find your answer? The community is on Discord.
Ask on Discord