Skip to content

feat: add Discord and Telegram notification channels - #24

Merged
vsilent merged 1 commit into
mainfrom
feat/notification-channels
Nov 13, 2026
Merged

vsilent merged 1 commit into
mainfrom
feat/notification-channels

Conversation

@vsilent

@vsilent vsilent commented Nov 12, 2026

Copy link
Copy Markdown
  • Discord (STACKDOG_DISCORD_WEBHOOK_URL): routed exactly like Slack (Critical/High/Medium). Plain content messages under the webhook's own name and avatar, truncated to Discord's 2000 character limit on a UTF-8 boundary.
  • Telegram (STACKDOG_TELEGRAM_BOT_TOKEN + STACKDOG_TELEGRAM_CHAT_ID): Bot API sendMessage, plain text without parse_mode (alert content can never break the request by looking like markup), truncated to the 4096 character limit. Both values required; a partial config does not enable the channel (unit-tested).
  • Telegram is alerts only: action notifications (bans, quarantines) are deliberately not routed there, per the product decision. Documented in code and in .env.sample.
  • Revives tests/alerting/: tests/integration.rs never included the module, so four files of tests never compiled or ran (including all the Slack and dedup tests). Added mod alerting;, fixed the one compile error (async send without await), cleaned the warnings dead code had accumulated.
  • Docs: README channel lists, .env.sample setup notes, quickstart snippet, CHANGELOG.
  • Verified: 470+8+155 tests (was 469+8+108: +3 Discord, +3 Telegram integration tests, +1 Telegram partial-config unit test, +44 revived), clippy -D warnings and fmt clean, website build clean.

Two new alert channels, routed exactly like Slack (Critical, High,
Medium):

- Discord (STACKDOG_DISCORD_WEBHOOK_URL): plain content messages under
  the webhook's own name and avatar, truncated to Discord's 2000
  character limit on a UTF-8 boundary.
- Telegram (STACKDOG_TELEGRAM_BOT_TOKEN + STACKDOG_TELEGRAM_CHAT_ID):
  plain text through the Bot API sendMessage, truncated to the 4096
  character limit. No parse_mode, so alert content can never break the
  request by looking like markup. Both values are required; a partial
  config does not enable the channel.

Telegram is alerts only: action notifications (bans, quarantines) are
deliberately routed away from it, and the channel list documents that.

Revives tests/alerting/, which tests/integration.rs never included: four
files of tests never compiled or ran. Added mod alerting;, fixed the one
compile error (async send without await), and cleaned the warnings the
dead code had accumulated.

Tests: 470+8+155 pass (was 469+8+108; +3 Discord, +3 Telegram integration
tests, +1 unit test for the partial Telegram config, +44 revived).
clippy -D warnings and fmt clean.
@vsilent
vsilent merged commit 64b4c5d into main Nov 13, 2026
9 checks passed
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.

2 participants