Nightbot Counter

Asked Aug 31, 2020·7 replies·Last activity 5 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Hello, I could need some advice.
I know that there is a counter command. I have an idea which Im not able to implement yet.

These are the functions Id like to have:
!pushups [will show how many pushups have been made]

!pushupadd1 !pushupadd5 !pushupadd10
[will add 1/5/10 to the counter]

Is this possible in any way?
Thanks in advance for the help <3

7 replies

I would suggest using @member’s Quote API

You can generate you tokens through this link https://twitch.center/customapi/quote/generate
The 8 digit token is your Public one and is fine to share.
The 16 digit token is your Private token and should not be shared.
(They both come after “token=“ And end before “&data”)

Here are the commands:

!addcom !pushup $(channel) has done $(eval a="$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)".replace(/([0-9]+\.[ ])/g,"").split(",");b=0;for(i=0;i<Math.floor(a.length-1);i++){c=Math.floor(b+parseInt(a[i]));b=c};b) pushups.
!addcom !pushupadd -ul=moderator $(eval a="$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=$(1),)";"$(1) pushups added.")
!addcom !pushupreset -ul=moderator $(eval a="$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&data=&clear=1)";"!Pushup command has been reset to 0.")

Only change the PUBLIC_TOKEN and PRIVATE_TOKEN in the commands for adding you just type any number to add to the total a few !pushupadd.

If there are any issues please let me know.

Thank you very much. Worked just fine 🙂

actually, the last command doesnt seem to be working i just realized...

i replaced private_token with my token like the first two commands. dont know what could be wrong

greets

09351628fe4f977f508f8e4186f75035.png

Sorry about that I forgot to put a “)” at the end. I edited the command it should work now. Just edit over the command with the new command.

Thank you very much! No everything is fine :D

Will be fun 😛

eb70cdc23fc64cd3609762901e884587.png

Sorry if I'm hijacking this, but really quickly - I modified this for something I wanted to do, and it works, but I'd prefer if Nightbot would not post any kind of message in chat when adding/clearing the "pushups"... is there any way to prevent the response? (changing the response to an empty string results in "[Error Connecting To WebEval Service]" ...)

Change the response to " " this should make it not reply with anything.

Didn't find your answer? The community is on Discord.

Ask on Discord