Timer without interval? | Shift timer so it's not based on the hour | Shifted timer

Asked Mar 28, 2022·1 reply·Last activity 4 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.

Is there a way to set a timer on a specific time without an interval, like every hour on the 30th minute ?
(e.g. 2.30pm, 3.30pm 4.30pm etc )
This would be a really good & helpful function for NightBot!

1 reply

Hey @Easy Skunk!

Yes you can!
Timers can include JavaScript code, we can use that to evaluate the time and only have an output if it's 30 minutes past an hour.

First set your timer's interval to 30 minutes, then here's the code, replace the YOUR_MESSAGE field:

$(eval t=parseInt('$(time Etc/UTC "m")'); if(t>=30){'YOUR_MESSAGE'})