8ball & Birthday Commands & Chat Donation Alerts

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)
  • Heists (using points)
  • gambling (using points)
  • dueling other people in chat (using points).
  • Donation chat alert
  • slots (using points)
  • betting system (using points)

The first two are possible and you can find how to in the documentation https://docs.nightbot.tv/

There’s an example of an 8ball command in the explanation of the eval command

And look at the count down variable for how to countdown to someone’s birthday

But the points and donation alerts aren’t something really possible on nightbot right now

got the 8ball working with a pastebin so thats awesome! But im still struggling with the bday one even after looking at all documentations

Show me how you are formatting the time in the command.

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

Hey @wyntreblossom07!

I got precisely what you need!

!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

Note: simplified version of my previous post: Translate variable output - Birthday command


And for the chat donation alerts, have a look there, I think it’s doable: Nightbot Alerts In Chat

So i did it the way you said and now when I do !birthday it just shows up in chat “today is my birthday” which is wrong LOL

!addcom _birthday $(eval d=$(countdown 01 06 $(query) 01:00:00 AM EST); $(query)==today?Today is my birthday!:My birthday is in ${d}:wink:

!addcom !birthday -a=_birthday $(eval y=$(time EST “1996”); t=$(time EST “0106”); if(t<0106){y}else if(t==0106){today}else{y+1})

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}`;)

Thanks. Sorry im really new to this XD

1 Like

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.

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