One way you could do this is by using the quote system API. You’ll get your TOKENS
by clicking on the second link in the post, use these in the commands I wrote. To know where to look for your PUBLIC_TOKEN
and PRIVATE_TOKEN
, look at the field bellow:
$(urlfetch https://twitch.center/customapi/quote?token=PUBLIC_TOKEN&data=$(querystring))
$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=$(querystring))
$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&data=$(querystring))
Keep your PRIVATE_TOKEN
secret, don’t share it anywhere. To add a command containing your PRIVATE_TOKEN
do it from the dashboard. Don’t use the chat as anyone could monitor it and copy the token, they could then edit your data.
To add success and attempts to the counters:
• !success
$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=s$(count))
• !failure
$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=a$(count))
Make sure !success
and !failure
are for moderators and above only and to add !total
as an alias to these commands.
For the main command:
• !total
$(eval q=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)`;s=q.match(/s\d+/g);a=q.match(/a\d+/g);s==null?s=0:s=s.pop().replace(`s`,``);a==null?a=0:a=a.pop().replace(`a`,``);`Success/Attempts: ${s}/${a}`)
And then to reset the counters:
• !sreset
!success \-c=0
• !freset
!failure \-c=0
• !totalreset
$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&clear=1)
Make sure !sreset
and !freset
have !editcom
as an alias, and that !sreset
, !freset
and !totalreset
are for moderators and above only as well.