Overview
We can set up a daily standup alert in 2 easy steps:- Get a Discord webhook URL.
- Use a cron expression to schedule a standup prompt to be sent to Discord every morning at 9am, Monday through Friday.
Just show me the code
Just show me the code
Getting a Discord webhook URL
If you want to try this out but you don’t have a Discord server, you can set one up easily for free. If you already have a Discord server, follow these instructions to get your webhook URL. If you want to test this out quickly using the Booper public Discord server, you can use this webhook URL:Scheduling your job
To set up your standup alert job on a recurring schedule, we’re going to use thecron
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)
.
Note that cron expressions are set in the UTC timezone by default.
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!