Set up a daily standup prompt on weekdays in Discord
Just show me the code
cron
option. The cron
field allows us to set a job on a schedule using a cron expression.
For example, if we wanted the alert to occur every weekday (Monday through Friday) at 9am, we would use the following cron expression: 0 9 * * 1-5
This expression says to run at the 0th minute
of the 9th hour
(i.e. 9:00am
) every 1st to 5th day of the week (Monday through Friday)
.
BOOPER_API_KEY
and DISCORD_WEBHOOK_URL
set in your environment, you can run the script below in your terminal.
(Get your personal API key here, or use our public API key if you just want to test it out quickly.)
cron
expression to run more frequently (e.g. */5 * * * *
to run every 5 minutes) if you want to test that it’s working without waiting until the next morning!