feat(bot): Accept/Reject buttons + role grant on accept#53
Merged
Conversation
Complete the Discord review loop (concept §5.1 step 8 / §11). The new-submission embed now carries Accept/Reject buttons; staff act without leaving Discord. - review embed gains Accept/Reject buttons (customId sub:<action>:<id>) alongside the existing dashboard link. - review-actions.ts handles the button: Manage Server check, then mirrors the web events route — updates status (accepted/rejected), writes a public status_change event, and queues a status_change DM to the applicant via the outbox (reusing 6b). - on accept, grants the guild's configured acceptedRole to the applicant (members.fetch by their Discord id → roles.add); best-effort, logs and continues on missing-permission/hierarchy errors. - the message is edited to show the decision and disable the buttons. No new gateway intent needed (single-member fetch is REST).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 finish — Task 3/5: Discord review actions + role grant
Completes the Discord review loop (concept §5.1 step 8 / §11). The new-submission embed now carries Accept / Reject buttons; staff act without leaving Discord, and acceptance grants the configured role.
Changes
customId: sub:<action>:<submissionId>) next to the dashboard link.review-actions.tshandles the button: Manage Server permission check, then mirrors the web events route — sets status (accepted/rejected), writes a publicstatus_changeevent, and queues astatus_changeDM to the applicant via the outbox (reusing 6b).acceptedRoleto the applicant (members.fetchby Discord id →roles.add); best-effort — logs and continues on missing-permission / role-hierarchy errors, the status change still stands.Notes
Verification
pnpm typecheck(web+bot) ✅ ·pnpm lint✅ ·pnpm test✅ · bot loads under tsx ✅