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!
I’ve set up 3 commands below:
!addwin and !addwinp2 which work in tandem to add a win to the running score and the number of kills per game (mod-only)
!wins which displays the number of wins and kills per game
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 !addwin -a=!addwinp2 $(eval a=parseInt(decodeURIComponent(`$(querystring)`));a>=0?`PRIVATE_TOKEN&data=`+a+`K|`:`foo`)
!addcom -ul=mod !addwinp2 $(eval a=`$(urlfetch https://twitch.center/customapi/addquote?token=$(query))`;`$(query)`.includes(`PRIVATE_TOKEN`)?`$(channel) won another game with `+`$(query)`.split(`&data=`).split(`K`)+` kills!`:`Invalid input!`)
!addcom -cd=5 !wins $(eval a=`$(urlfetch https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)`;a.match(/K/g)!=null?b=a.match(/K/g).length:b=0;a=a.slice(0,a.length-1);b>0?c=`(`+a.split(`|`).join(`, `)+`)`:c=``;`$(channel) has `+b+` wins `+c)