Nightbot command for only removing 1 on counter not reset

Edit

I recommend this newer/easier version of the command


Here you go

To generate your tokens go here https://twitch.center/customapi/quote/generate they come in between token= and &data= the 8 digit one is your public and the 16 digit one is your private.

!counter this checks the counter.

$(eval a=`$(urlfetch https://twitch.center/customapi/quote/list?token=Public_Token&no_id=1)`;a!=`There are no quotes added`?`There is ${a.split(` `)[0]}${a.split(` `)[1]} deaths`:`There is 0 deaths`)

!add adds to the counter defaults to one

$(eval a=`$(urlfetch https://twitch.center/customapi/quote/list?token=Public_Token&no_id=1)`;c=1;if(parseInt(`$(1)`)==parseInt(`$(1)`)+0){c=$(1)}else{c=c};b=``;if(a==`There are no quotes added`){f=``;e=`add`;a=0}else{f=`1%20`;e=`edit`;a=parseInt(`${a.split(`,`)[1].split(` `)[0]==`plus`?``:`-`}${a.split(`,`)[1].split(` `)[1]}`)};if(a>=0){b=`plus`}else{b=`minus`};`${e}quote?token=Private_Token&data=${f},${b}%20${Math.floor(a+c)} ${c}`)

Set alias to _add

_add

$(eval a=`$(urlfetch https://twitch.center/customapi/$(1))";b="$(urlfetch https://twitch.center/customapi/$(1))`;`You added $(2) to the death counter`)

!subtract subtracts from the counter defaults to one

$(eval a=`$(urlfetch https://twitch.center/customapi/quote/list?token=Public_Token&no_id=1)`;c=1;if(parseInt(`$(1)`)==parseInt(`$(1)`)+0){c=$(1)}else{c=c};b=``;if(a==`There are no quotes added`){f=``;e=`add`;a=0}else{f=`1%20`;e=`edit`;a=parseInt(`${a.split(`,`)[1].split(` `)[0]==`plus`?``:`-`}${a.split(`,`)[1].split(` `)[1]}`)};if(a>=0){b=`plus`}else{b=`minus`};`${e}quote?token=Private_Token&data=${f},${b}%20${Math.floor(a-c)} ${c}`)

Set alias to _subtract

_subtract

$(eval a=`$(urlfetch https://twitch.center/customapi/$(1))";b="$(urlfetch https://twitch.center/customapi/$(1))`;`You subtracted $(2) to the death counter`)
1 Like