Overview

We can set up a daily standup alert in 2 easy steps:

  1. Get a Discord webhook URL.
  2. Use a cron expression to schedule a standup prompt to be sent to Discord every morning at 9am, Monday through Friday.

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:

https://discord.com/api/webhooks/1147917553176412232/A6_FKaVh2Bxme7uj5wDnh40k-cOedEswWaWve0PJZKzAnjzUoa-2PYyBKm9D7SXq1Cyk

To see it in action, run this in your terminal and then check the #standup channel.

curl -X POST \
'https://discord.com/api/webhooks/1147917553176412232/A6_FKaVh2Bxme7uj5wDnh40k-cOedEswWaWve0PJZKzAnjzUoa-2PYyBKm9D7SXq1Cyk' \
--header "Content-Type: application/json" \
--data-raw '{"content": "Hello from the example page!"}'

Scheduling your job

To set up your standup alert job on a recurring schedule, we’re going to use the 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).

Note that cron expressions are set in the UTC timezone by default.

Assuming you have your 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.)

If you’re not using environment variables, you can run this script using the public API key and public Discord webhook URL from above:

(If you run the script above, you can check that it scheduled something on the jobs page of the public dashboard.)

Feel free to adjust the 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!