Cloudflare Worker that turns Discord forum posts into GitHub issues. Moderators triage feedback threads with /accept, /deny, /done; accepting opens an issue in the repo configured for that forum channel + tag combination, and the thread is updated when the issue is closed on GitHub. Built on Hono, with KV holding the thread ↔ issue mapping.
GET /— liveness check (discord-bot ok).POST /discord— Discord interaction webhook (slash commands, signed viaDISCORD_PUBLIC_KEY).POST /github— GitHub App webhook for issue close events.
src/index.ts— Hono root; mounts/discordand/github.src/discord.ts— slash-command handlers (/accept,/deny,/done).src/github.ts— issue-close webhook handler that updates the originating Discord thread.src/config.ts— forum-channel-to-repo routing rules. Add new forums and tag filters here.src/commands.ts— slash command definitions; re-register vianpm run register-commandsafter edits.src/crypto.ts— Discord webhook signature verification.
npm install
cp .dev.vars.example .dev.vars # fill in Discord + GitHub App creds
npm run dev # http://localhost:8787The bot only acts on inbound webhooks, so plain wrangler dev isn't reachable from Discord/GitHub. Either:
wrangler dev --remote— runs the Worker on Cloudflare's edge so webhooks reach it.- Tunnel
localhost:8787over HTTPS via cloudflared or ngrok, then point the Discord interaction URL and GitHub App webhook URL at the tunnel. - Deploy a separate dev Worker (
wrangler deploy) and test end-to-end against it.
After editing src/commands.ts, re-register commands with Discord:
npm run register-commandsWhen adding a new forum route, dump tag IDs with:
npm run forum-tagsnpm test # vitest
npm run typecheck # tsc --noEmitPushing to main triggers .github/workflows/build-and-deploy.yml. Manual deploys use npm run deploy. Production secrets live in Cloudflare — set each one with wrangler secret put. The full list is in .dev.vars.example.
The KV namespace KV (declared in wrangler.jsonc) stores the thread ↔ issue mapping. No D1 or other bindings.
We are not affiliated with the FAA or any aviation governing body. This software is for flight simulation use on the VATSIM network.