INTEGRATION

Webhook Setup

Receive immediate notifications in Discord or Telegram when an alert fires.

Discord

Create a webhook in your Discord server under Server Settings → Integrations → Webhooks, copy the URL, and add it to the watcher environment file.

watcher/.envbash
DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/12345/abcdef..."
discord-payload.jsonjson
{
  "embeds": [{
    "title": "🚨 SentinelGuard Alert: CRITICAL",
    "description": "Rule TVL_VELOCITY triggered for protocol 9W95...",
    "color": 16711680,
    "fields": [
      { "name": "Alert ID", "value": "a1b2c3d4", "inline": true },
      { "name": "Score",    "value": "95",       "inline": true },
      { "name": "Slot",     "value": "245012344","inline": true },
      { "name": "At Risk",  "value": "$125,000", "inline": false }
    ]
  }]
}

Telegram

Create a bot via @BotFather on Telegram to get a bot token, then get your chat ID by messaging @userinfobot. Add both to the watcher environment file.

watcher/.envbash
TELEGRAM_BOT_TOKEN="7123456789:AAHdqTcvCH1vGWJxfSeofShs0K84aaaaaa"
TELEGRAM_CHAT_ID="-1001234567890"
telegram-payload.jsonjson
{
  "chat_id": "-1001234567890",
  "text": "🚨 SentinelGuard Alert: CRITICAL

Rule: TVL_VELOCITY
Score: 95
At Risk: $125,000
Slot: 245012344
Protocol: 9W95...",
  "parse_mode": "Markdown"
}

For group chats, the chat_id is negative (starts with -100). For direct messages to a user, it is a positive integer.

Choosing a Channel

You can configure both at the same time — the watcher dispatcher fans out to all configured channels via Promise.allSettled, so a failure in one does not block the other.

If neither DISCORD_WEBHOOK_URL nor TELEGRAM_BOT_TOKEN is set, alerts are still logged internally but no external notification is sent.

Was this page helpful?