ModMailManager — Discord Interactions Worker ============================================= This Cloudflare Worker is the Discord-facing companion for the ModMailManager Reddit app (https://developers.reddit.com/apps/modmailmanager). Source code: https://github.com/MissSicariaTest/ModMailManager The Reddit app does NOT call this Worker. All traffic here is between Discord and this Worker. WHY THIS SERVICE EXISTS ----------------------- Devvit apps cannot receive inbound HTTP requests from external services. Discord ticket buttons (Claim / Close / Resolved / Unresolved / Reassign / Reopen) require a publicly reachable Interactions Endpoint that verifies Discord's Ed25519 request signatures and responds within 3 seconds. This Worker fills that role. ENDPOINTS --------- POST / (and /discord/interactions) Discord Interactions Endpoint. Receives button clicks and modal submissions directly from Discord, verified via Ed25519 signature. Updates ticket embeds, moves closed tickets to the archive channel. GET /api/health Public, unauthenticated configuration health check (booleans only). GET / and /docs This documentation. Authenticated /api/* endpoints (Bearer WORKER_SECRET) exist for operator diagnostics (ticket lookup, report snapshot) but are not used by the Reddit app. SCHEDULED JOBS -------------- A Cloudflare cron trigger posts a Daily Ticket Report (aggregated button-action counts per moderator) at ~8:05 AM US Eastern. Each subreddit's report goes to REPORTING_WEBHOOK_PRIMARY or REPORTING_WEBHOOK_SECONDARY, with REPORTING_WEBHOOK as a shared fallback. DATA HANDLING ------------- - Stored in Cloudflare KV: ticket state records and aggregated action counters. Counters reset after each daily report cycle. - Data sources: Discord button interactions and embed content already visible in the moderators' own Discord channels. - Privacy policy: https://github.com/MissSicariaTest/ModMailManager/blob/main/PRIVACY.md