So I am new to streaming, nightbot, coding, and everything related. Most of my complex nightbot commands have just been copied and pasted from random places on the internet.
I can do things like $(count) and $(touser) but thats about where my ability to understand the syntax of commands dies.
I currently use like 6 different bots for different commands and I am trying to bring as many of those commands to nightbot as I can so that I can limit the amount of bots im using.
I have tried reading other topics/posts with similar questions but my brain just gets lost the minute i see the code.
Im trying to create the following
8ball command with multiple random custom responses.
birthday command (There are X months/days left until Wyn’s birthday!)
Loyalty points system (not channel points on twitch but a custom chat currency)
I had just copy and pasted from the documentation, and then edited it. I got it to say “24 years” but i want it to say "wyns bday is in X days/months/weeks
!addcom !birthday -a=_birthday $(eval y=$(time TIMEZONE "YYYY"); t=$(time TIMEZONE "MMDD"); if(t<MONTHDAY){y}else if(t==MONTHDAY){`today`}else{y+1})
!addcom _birthday $(eval d=`$(countdown MONTH DAY $(query) 00:00:00 AM TIMEZONE)`; `$(query)`==`today`?`Today is my birthday!`:`My birthday is in ${d}`;)
You’ll need to replace TIMEZONE with yours, get the full available time zones list here. MONTH will need to be replaced with your month number, and DAY with your day number.
→ example: if you’re born on October 25th, then MONTH is 10, DAY is 25, and MONTHDAY is 1025
With such command you won’t need to update the date every year.
Feel free to update the output text in the second command: _birthday
You replaced YYYY, MM and DD when it was not needed, I would have specified otherwise.
Here are the commands properly filled with your birthday:
!addcom !birthday -a=_birthday $(eval y=$(time EST "YYYY"); t=$(time EST "MMDD"); if(t<0106){y}else if(t==0106){`today`}else{y+1})
!addcom _birthday $(eval d=`$(countdown 01 06 $(query) 00:00:00 AM EST)`; `$(query)`==`today`?`Today is my birthday!`:`My birthday is in ${d}`;)
It’s alright, I could have specified that these were not to be changed as well, after all it happens often that people change more than needed and it breaks the command, like with the $(channel) variable for example, but I didn’t want to create confusion so I decided to not mention them.