Skip to content

Add support for multiple Discord webhooks with per-webhook thresholds#15

Open
bartschliam wants to merge 2 commits into
fsvreddit:mainfrom
bartschliam:main
Open

Add support for multiple Discord webhooks with per-webhook thresholds#15
bartschliam wants to merge 2 commits into
fsvreddit:mainfrom
bartschliam:main

Conversation

@bartschliam

Copy link
Copy Markdown

Changes

  • Allow users to configure multiple Discord webhook URLs (separated by newlines) instead of just one
  • Add ability to set different alert thresholds for each webhook
  • Updated settings UI to clarify that multiple URLs are supported
  • Modified alert message tracking to store message IDs per webhook
  • Alerts are now sent to all configured webhooks based on their individual thresholds

How it works

Multiple Webhooks

Users can enter multiple Discord webhook URLs in the "Discord webhook URLs" setting, each on a new line:
https://discord.com/api/webhooks/123456789/abc
https://discord.com/api/webhooks/987654321/xyz

Per-Webhook Thresholds

Users can optionally set different thresholds for specific webhooks in the "Per-webhook thresholds (optional)" setting. Format: one per line as WEBHOOK_URL|threshold:NUMBER|ageHours:NUMBER

Example:
https://discord.com/api/webhooks/123456789/abc|threshold:20|ageHours:12
https://discord.com/api/webhooks/987654321/xyz|threshold:50|ageHours:24

If left blank, all webhooks use the default global thresholds.

Use Cases

  • Alert multiple Discord servers/channels about the same modqueue events
  • Use stricter thresholds for critical channels and looser ones for notifications channels
  • Have one webhook alert on small queue size and another only on very large queues

Backwards Compatible

Existing setups with a single webhook continue to work exactly as before. The per-webhook thresholds feature is completely optional.

@bartschliam

Copy link
Copy Markdown
Author

Hi @fsvreddit,

I just submitted a PR that adds support for multiple Discord webhooks with per-webhook thresholds. I thought this would be a useful feature for mod teams that want to:

  • Alert multiple Discord servers/channels simultaneously
  • Use different alert thresholds for different channels (e.g., stricter for critical channels, looser for notification channels)
  • Have granular control over which webhooks get notified based on queue conditions

I'm happy to refine this based on your feedback, or if you'd prefer to implement it differently, just let me know! Would love your thoughts on whether this approach works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant