Discord Integration Hub

Discord is OpenClaw’s primary ops alerting channel — every automated monitoring system in the platform posts alerts here before anywhere else. The Aurora bot (guild 1473795019575132222, 31 channels) handles both structured embeds for cron/monitoring alerts and interactive slash commands for operator tasks. Read this hub when wiring any new alert source or modifying existing alert routing.

Quick reference

FieldValue
VendorDiscord Inc
URLhttps://discord.com / https://discord.com/developers/applications
KB docAPI · WEBHOOKS
Auth methodBot token (Authorization: Bot <token> header); Ed25519 sig for interaction webhooks
Auth credentialop://Aurora/discord/bot-token
Cred-proxy portn/a (until B1-B6 ratified)
Webhook portn/a (outbound-only; Discord posts to our server for interactions only)
Webhook handlern/a (no inbound webhook handler running for alerts)
Webhook dedup tablen/a
Tunnel pathn/a
Outbound API basehttps://discord.com/api/v10
Rate limits50 req/s global per bot token; 30 req/60s per webhook URL; ~5 msg/5s per channel
Rate-limit action429 → exponential backoff (3 retries) using retry_after from response body
CostFree (no API call costs)
Backup/recoveryVendor-owned (Discord cloud); message history retained per guild retention settings
Discord alert channelops (primary) · incidents (P0/P1 escalations)
Drift cadenceOn bot token rotation; after guild permission changes
Statusproduction

Guild + channel map

ChannelPurposeAlert sources
opsPrimary ops alerts — all monitoring systemsAll sources listed below
incidentsP0/P1 escalation — requires immediate responseFailed services, cost-overage threshold breaches
aurora-buildAurora agent status updates, crash notificationsnotify-service-crash.sh (OnFailure systemd hook)

Guild ID: 1473795019575132222

Alert sources (complete enumeration — PF-A)

All of the following systems post to Discord ops as their primary alert channel:

SourceScheduleTrigger conditionAlert severity
vault-sync (openclaw-vault-sync.timer)Every 15 minrsync failure, git commit error, push failurewarn
security-audit-funnel (security-audit-funnel.timer)Monday 06:00 America/Los_AngelesUnregistered live paths, missing approved paths, sig failure rate >5%, zero-event endpoints, stale WAF rulesP0/P1
friction-report (nightly cron)Daily 02:00 America/Los_AngelesFrustration signal detection, P0/P1/P2 fix backlogP0-P2
cost-overage (cost-monitor)On threshold breachLLM spend exceeds configured budget ceilingP1
tool-calls-health-check (tool-calls-health-check.timer)Every 5 min>10% delta between Portkey call count and tool_calls table inserts (CHOKEPOINT-1 drift)P0
failed-service MTTR (daily cron)DailyAny service in failed state >24h (G-FAILED-SERVICE-MTTR)P1
governance-log-freshness (weekly-index-audit.timer)WeeklyWORKFLOW-PATTERNS.md, SYSTEM-FRICTION-LOG.md, CHANGELOG.md, AUDIT-LOG.md stale >14 days (G-GOVERNANCE-LOG-FRESHNESS)P1
notify-service-crashOn systemd OnFailure= eventAny systemd unit with OnFailure=notify-crash@.service configured crashesP0

Components

  • /home/opsadmin/.openclaw/workspace/scripts/discord-send-webhook.sh — CLI wrapper; calls discord-webhook-sender.js with agent ID + message
  • /home/opsadmin/.openclaw/workspace/scripts/discord-webhook-sender.js — Node.js webhook sender; reads channel map from config
  • /home/opsadmin/.openclaw/workspace/config/discord-webhooks.json — channel ID → webhook URL map (20+ channels); credential stored as URL (G-NO-PLAINTEXT-CREDS: webhook tokens in this file must be rotated if exposed)
  • /home/opsadmin/.openclaw/tools/hooks/notify-service-crash.sh — systemd OnFailure handler; posts crash embeds to aurora-build channel
  • /home/opsadmin/.openclaw/workspace/scripts/discord-add-to-existing-threads.js — thread management utility
  • /home/opsadmin/.openclaw/workspace/scripts/discord-thread-auto-add-bot.js — auto-adds bot to new threads
  • /home/opsadmin/.openclaw/workspace/scripts/discord-assign-core-team.js — guild role assignment
  • ~/.openclaw/.discord-keys — legacy key file; must migrate to op://Aurora/discord/bot-token pattern

How it’s used

  • Trigger: any monitoring script, cron job, or systemd OnFailure handler with an alert to send calls discord-send-webhook.sh <agent-id> <message> or posts directly via the REST API with the bot token
  • Workflow: script → discord-webhook-sender.js reads discord-webhooks.json → selects channel by agent ID → POST /channels/{id}/messages with structured embed
  • Agents involved: _summary orchestrates most Discord interactions; all 36 agents can route alerts via the gateway’s Discord channel map
  • Failure mode: if discord-webhooks.json is missing or malformed, all alert delivery silently fails; if bot token is expired/revoked (401), embeds fail with no fallback; 429 rate limit on high-volume alert bursts (>5 msg/5s per channel)
  • Success criteria: POST /channels/{id}/messages returns 200 with message object; embed appears in channel within 1s

Interaction webhooks (inbound — slash commands)

Discord sends interaction payloads to a configured HTTPS endpoint when users invoke slash commands. Auth method: Ed25519 signature (X-Signature-Ed25519 + X-Signature-Timestamp headers). Public key stored at op://Aurora/discord/public-key.

  • Respond within 3 seconds or defer with deferReply() (up to 15 min to editReply)
  • Verify signature with discord-interactions npm package before processing any payload
  • No interaction endpoint is currently registered in cloudflare FUNNEL-REGISTRY — add before exposing slash commands to production

/discord skill

The /discord skill (~/.claude/skills/discord/) wraps the message tool with channel=discord routing. Invoke via Skill("discord") for structured ops notifications from Claude Code sessions.

Discord is a notification sink in the webhook/tunnel cluster — it receives alerts from all other integration hubs via bot token POST, but does not itself require a public tunnel endpoint for normal alerting operations.

HubRelationship
cloudflareTunnel + WAF govern any future interaction webhook endpoint; FUNNEL-REGISTRY required before exposing
hetznerVPS is the compute host for all Discord alerting scripts
slackParallel comms channel; Aurora uses both but Discord is primary for ops alerts
githubvault-sync posts to ops on push failure; traewayrer/openclaw-vault commit activity visible
CredentialReferenceStatus
Bot tokenop://Aurora/discord/bot-tokenP1 — rotate after any session exposure
Public key (interaction sig)op://Aurora/discord/public-keyVerify exists in 1Password Aurora vault
Webhook URLs (per-channel)discord-webhooks.json (webhook token embedded in URL)P1 — audit for plaintext exposure

See 1password for Aurora vault structure and rotation procedures.

Agents that touch this

  • _summary — primary Discord bot operator; handles slash commands, embeds, thread management
  • All 36 agents via discord-send-webhook.sh for automated ops alerts

Skills that invoke this

  • discord/discord skill; wraps message tool with channel=discord routing

Plans that govern this

Feedback rules

KB / source docs

  • API — Discord API v10 reference (last verified 2026-03-04); guild ID, rate limits, embed schema
  • WEBHOOKS — Incoming webhook execution, Ed25519 signature verification, Slack/GitHub compat formats

System maps

Open issues / TODOs

  • P1: ~/.openclaw/.discord-keys legacy key file — verify it’s not git-tracked and migrate to op://Aurora/discord/bot-token pattern
  • P1: discord-webhooks.json contains webhook URLs with embedded tokens — confirm file is chmod 600 and not in any tracked repo; rotate any exposed webhook URLs
  • P1: discord-thread-auto-add.service is in failed state (token undefined) per G-FAILED-SERVICE-MTTR audit — fix or disable
  • P2: No interaction endpoint registered in FUNNEL-REGISTRY — if slash commands are to be exposed publicly, register endpoint and add Ed25519 sig verification before going live
  • P2: Alert dedup — high-frequency events (tool-calls-health-check fires every 5 min) could flood ops; consider rate-limiting to 1 alert per 15 min per alert type

Recent activity

  • 2026-05-03: Hub created by W1-S6 (Wave 1 hub authoring pass)
  • 2026-05-03: notify-service-crash.sh wired to systemd OnFailure for max-plan stack services
  • 2026-05-01: G-FAILED-SERVICE-MTTR daily cron added; Discord ops is primary alert target
  • 2026-05-01: G-GOVERNANCE-LOG-FRESHNESS weekly audit cron added; Discord ops is alert target
  • 2026-03-04: KB docs (API.md + WEBHOOKS.md) last verified