# Schedule Discord messages with a webhook

Send messages to a Discord channel on a schedule: server announcements, daily reminders, game-night pings, or reports filled in from any API. cronservices posts through a channel webhook, so you don't need to host a bot.

## Example: a weekly announcement

Every Friday at 18:00 Paris time, remind the server about game night:

```json
{
  "name": "Game night reminder",
  "cron": { "expression": "0 18 * * FRI", "time_zone": "Europe/Paris" },
  "nodes": [
    { "id": "post", "discord_send_message": {
        "webhook_url": "https://discord.com/api/webhooks/123456789012345678/abcDEF_ghi-JKL",
        "content": "@everyone Game night starts in 2 hours! 🎲",
        "username": "Events" } }
  ]
}
```

## Example: a daily exchange rate in a trading channel

```json
{
  "name": "EUR/USD to #markets",
  "cron": { "expression": "15 16 * * 1-5", "time_zone": "Europe/Berlin" },
  "nodes": [
    { "id": "rate", "frankfurter_latest": { "from": "EUR", "to": "USD" } },
    { "id": "post", "discord_send_message": {
        "webhook_url": "https://discord.com/api/webhooks/123456789012345678/abcDEF_ghi-JKL",
        "content": "**EUR/USD** ECB reference rate for {{ $.date }}: **{{ $.rates.USD }}**" } }
  ]
}
```

## Set up

In Discord, open **Channel settings → Integrations → Webhooks → New Webhook**, pick the channel, and copy the URL into `webhook_url`. Anyone with the URL can post to the channel, so keep it private.

## Reference

### Send a Discord message: `discord_send_message`

**Sends** POST to the webhook URL with `?wait=true`. **Output** for the next step: The created message, with its `id` and `channel_id`.

| Field | Type | Notes |
| --- | --- | --- |
| `webhook_url` | string, required | A channel webhook, `https://discord.com/api/webhooks/<id>/<token>`. Channel settings → Integrations → Webhooks. |
| `content` | string, required | Discord markdown, up to 2,000 characters. Placeholders allowed. |
| `username` | string | Overrides the webhook’s name. Placeholders allowed. |
| `avatar_url` | string | Overrides the webhook’s avatar. Placeholders allowed. |

## More ideas

- Post a daily server rules reminder at noon: `0 12 * * *`.
- Count down to a launch with a message every day at 09:00 until a one-time `run_at` job announces it.
- Post open GitHub issues for contributors every Monday: `0 10 * * MON`.
- Announce a stream 15 minutes before it starts with a one-time job.
