How to make a count command

How can I make a command where evreyone can say for instance !addnumber and the number goes up and it would be like a community thing also I haven’t learned how to code like at all so I’m gonna need alot of help with this.

Yes firstly generate your two tokens here:
https://twitch.center/customapi/quote/generate
They come between token= and &data
The public token is 8 digits and the private token is 16 digits

!addnumber command:

$(eval a=`$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=$(1),)`;`Added $(1) to the total.`)

!total command:

$(eval N=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)`.split(`,`);x=0;for(i=0;i<N.length-1;i++){x=x+parseInt(N[i])};`The total is ${x}.`)

Wait… Why are you using the quote API here @potatoeaterlove?
Simply use the $(count) variable… No?
The application they’re asking for is simple enough, we don’t need to add extra.

Hey @mission_infection!

You can use the following command, copy-paste it in your chat:

!addcom !addnumber The total is $(count).
2 Likes

Thank you so much I was so confused

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.