Counter command help

I am trying to write a command that will count up in days/time from the current time of the command being used.
This is what I have, but it gives me a “not a valid timezone” error.

It has been $(countup $(time US/Mountain "MMMM Do YYYY, h:mm:ss)) since I hurt myself on stream. FeelsGoodMan.

I also want to make a command to reset that counter.

In the time variable after the hh:mm:ss put a z like this:

$(countup $(time Us/Mountain "MMMM Do YYYY hh:mm:ss a z"))

Also the best way to make a resetable timer would be to use the quote api.
I’ve made something similar in the past so if you need help let me know

Yes, please. That would be great!

Generate you tokens here https://twitch.center/customapi/quote/generate
You’ll get 2 tokens 8 digit one is your public 16 digit one is your private
They come after “token=” and before “&data”

Commands to display counter

It has been $(countup $(eval a="$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)".split(",");a[a.length-1])) since I hurt myself on stream. :( 

Command to start a new timer

$(urlfetch $(eval Time="$(time EST "MMMM D YYYY hh:mm:ss a z")".replace(" ","%20");"https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=,"+Time))

Optional can alias this to another command so it shows a custom message or nothing
Make userlevel Moderator or Owner

Optional Command (I suggest “_” plus the “LAST_COMMAND_NAME” like “_hurt”)

$(eval a="YOUR_MESSAGE";a)

If you want no response make the message a space
make user level the same as the last command

Also if it’s not clear basically replace anything in caps with the correct data.
I haven’t tested this out so if there are any issues feel free to tell me but it should work fine.

1 Like

I am getting this error

It has been Invalid timezone specified. For a list of timezones, check https://docs.nightbot.tv/commands/variables/time#timezones

This is my input

It has been $(countup $(eval a="$(urlfetch json https://twitch.center/customapi/quote/list?token=793cf9c7)".split(",");a[a.length-1])) since I hurt myself on stream. FeelsBadMan

Sorry I forgot to include a “,” in the second command it’s comes right after data= you can change it yourself or just reboot and paste the command.Also I edited the first command so the quote list doesn’t have any ids and I edited the format of the time variable as it was wrong.

Now I am just confused. thanks for trying to help. I guess this just isn’t for me

I fixed the commands in the previous message you can just recopy and paste them and fill in the info again. Sorry if I caused any confusion.

Still saying invalid time zone

Idk what to tell you from my testing it’s working fine. Did you recopy both commands?

I did recopy both. I replaced TOKEN with the tokens I got from the link.

Did you use the command to add the time to the list before using the one that displays it? Because it there are no times in your list that could be the issue.

Copied everything you pasted. Put them into night bot with a command for each. Says invalid timezone. I give up. Thank yo very much fro trying

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