Hell y'all, new nigthbot user here, struggeling to create custom commands.
I am looking for a command to calculate the age of 8 different owlets, depended of the owlets name given. Thinking of something like:
!age Jakk => "Jakk is 21 days old." (Jakk is 1 name, we have 7 more)
His age i can determine with ' $(COUNTUP birthdate)' . But how do i make the command select the correct birthdate for each of the 8 owlets?
It needs to check the given name after !age [name], with 8 possible names and select the correct brithdate with that name.
All support is welcome.
PS: I got this to convert the $^&@ time format coming out of COUNTUP, to show ONLY in total days and drop the time details:
$(eval a=$(countup 03 07 2020 12:00:00 PM PST8PDT).replace( year,|year).replace( month,|month).replace( day,|day).split( );b=0;for(i=0;i<a.length;i++){c=parseInt(a[i].split(|)[0]);if(a[i].includes(|year)){b+=c*365;a[i]=`;}if(a[i].includes(|month)){b+=c*31;a[i]=;}if(a[i].includes(|day)){b+=c;a[i]=;}}${b} days` ; )
So what i need is a lookup of the name to insert the correct known birthdate.