A bot that posts my latest schlaupdate to my Discord server.
I computed the schlaupdate to be at 9 AM UTC, so the bot runs at 9:10 AM UTC.
The bot uses Cloudflare Workers as the runtime with a cron trigger. Cloudflare free plan is sufficient for this use case.
The list of user IDs to fetch is configured in the wrangler.toml file.
The Discord webhook is managed using Worker Secrets.
For local development, create a .dev.vars file with content:
DISCORD_WEBHOOK_URL=...For deployment, set the secret value with wrangler:
npx wrangler secret put DISCORD_WEBHOOK_URLnpx wrangler deploy