Перейти к основному содержимому

Webhook Definition

A Discord destination, declared once and referenced everywhere.

Each subsystem used to carry its own copy of the settings — URL, username, avatar. Changing channel meant editing every manifest, and nothing guaranteed they pointed at the same place. The destination is now an entry of its own: a bug report, a shop sale and a chat message can target the same channel without the URL being written three times.

Configuration

FieldTypeDefaultDescription
enabledBooleantrueSilences delivery without removing the references pointing at it
urlString""Full Discord webhook URL
usernameString""Name shown instead of the webhook's own (empty = the one configured on Discord)
avatarUrlString""Avatar shown instead of the webhook's own (empty = the one configured on Discord)
pingRoleIdsList<String>[]Roles mentioned by every message going through this destination

A destination is usable when enabled is true and url is not blank. An empty or disabled reference sends nothing and reports nothing: that is the normal way of publishing nothing. Only a reference naming a deleted entry is logged, because it betrays a page pointing at something that no longer exists.

pingRoleIds holds the permanent mentions. One-off mentions — a critical bug report, for instance — stay the caller's business and add up with these.

Who can use it

Any entry can hold a Ref<WebhookDefinitionEntry> and deliver through it. Inside this extension:

An extension that must not depend on this one names the destination by id instead — that is how shop notifications work.

Migration

Pages written before v0.1.0 stored the webhook inline on each manifest. They are converted on first start:

  • one webhook_definition entry is created per distinct destination, so manifests configured identically end up sharing a single entry;
  • the manifests are repointed at it;
  • a backup of every rewritten page is taken beforehand, under backup/community-webhook-v1/;
  • the conversion is idempotent — running it again changes nothing.

Bug reports lose their second on/off switch in the process: an empty destination is the disabled state. A manifest that was switched off keeps its URL on a disabled destination rather than losing it.