1
0
Fork 0
polaris-task-force/src/bot/lib
Z8MB1E c4cbe43c4f fix(bot): survive a stale Discord interaction instead of crashing
A manual /rollcall took the bot down: the command fetched the guild member
and ran the staff check before acknowledging, missed Discord's 3 second ack
window, then died on "Unknown interaction" when it tried to defer (and again
when the error path tried to reply). discord.js re-emits a rejected event
listener on the client as an 'error' event, and with no handler attached Node
threw and exited the process.

Ack first, protect the error paths:
- /rollcall, /remind-evaluations and /debug defer immediately and report
  permission denials through editReply.
- safeEphemeralReply (bot/lib/interactions.ts) never rethrows, and the RSVP
  and transfer handlers use the same guarded behaviour.
- client.on(Events.Error) logs instead of exiting. The entrypoint restarts a
  dead bot after 5 seconds, so the previous symptom was a silent gap.
2026-11-03 12:50:29 -05:00
..
achievementRender.ts feat(minigames): notify winners and announce achievements on Discord 2026-10-11 17:06:52 -04:00
changelogRender.ts fix(bot): read open-ended changelog ranges in the newest direction 2026-10-13 11:18:24 -04:00
debugActions.ts feat(bot): add staff-only /debug command for previewing and reposting bot messages 2026-10-26 18:07:05 -04:00
interactions.ts fix(bot): survive a stale Discord interaction instead of crashing 2026-11-03 12:50:29 -05:00
presence.ts feat(bot): add editable Discord Rich Presence via command and CMS 2026-10-12 10:21:37 -04:00
resolve.ts feat(bot): add Discord bot scaffold with sign-up, attendance embeds, and notification bridge 2026-08-12 12:39:00 -04:00
roles.ts feat(discord): integrate RBAC into Discord bot 2026-08-19 19:48:28 -04:00
transferMessaging.ts feat(bot): Add assignment transfer bot services 2026-08-31 23:40:21 -04:00