Bots Open Roar

Make a bot

Webhooks

A webhook is a secret link that posts into one channel. Send it a web request and the message appears, with whatever name and picture you choose. There's no bot account, no token and nothing to keep running.

Good for

Webhooks only post. To read messages or answer people, make a bot.

Make one

  1. Open the channel's webhooksOpen Channel Settings → Webhooks (or Server Settings → Webhooks to see them all). You need Manage Webhooks.
  2. Make itPress New Webhook and give it a name. Its posts show that name unless a post picks another one.
  3. Copy the URLPress Copy URL. It looks like https://roarnode.com/api/v1/webhooks/<id>/<token>, or …/v1/instances/<node>/http/api/v1/webhooks/… for a node that's reached through the relay.

The URL is the password. Anyone with it can post in the channel. Keep it out of public code and screenshots. If it leaks, delete the webhook and make a new one.

A channel can have up to 15 webhooks. Text, announcement, voice and stage channels can all have them.

Send a message

Send a POST with a JSON body to the URL:

curl
curl -X POST "$ROAR_WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -d '{"content": "Hello from a webhook! 👋"}'
JavaScript (any runtime with fetch)
await fetch(process.env.ROAR_WEBHOOK_URL, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ content: "Hello from a webhook! 👋" }),
});
Python (with requests)
import os, requests

requests.post(os.environ["ROAR_WEBHOOK_URL"], json={"content": "Hello from a webhook! 👋"}).raise_for_status()
PowerShell
Invoke-RestMethod -Method Post -Uri $env:ROAR_WEBHOOK_URL -ContentType "application/json" `
  -Body (@{ content = "Hello from a webhook! 👋" } | ConvertTo-Json)

With Roar.js it's new Webhook(url).send("Hello!"): see the reference.

What you can send

Field
contentThe text, up to 4000 characters, with Markdown. Webhooks may ping @everyone.
embedsUp to 10 embed cards (about 12 KB in total). The fields are the same as a bot's: Embeds.
usernameThe name shown on this post (1–80 characters).
avatar_urlA picture for this post: an https:// link to an image.

At least one of content or embeds is needed. The node answers 200 with the message it posted.

A post with an embed
{
  "username": "Server Monitor",
  "avatar_url": "https://example.com/monitor.png",
  "content": "Heads up:",
  "embeds": [{
    "title": "The game server is back",
    "description": "It was down for 4 minutes.",
    "color": 6281578,
    "fields": [{ "name": "Players online", "value": "12", "inline": true }],
    "footer": { "text": "checked every minute" }
  }]
}

In JSON, color is a number: #5fd96a is 0x5fd96a, which is 6281578.

Limits