Draft
Conversation
Create detailed plan covering: - Multi-Server Aggregation (Issues #1/#2) - Discord OAuth Provider (Issue #3) - RallyRound API Client (Issue #4) - Bot Commands (Issue #5) - Voice Channel Presence Tracking (Issue #6) - Webhook Receiver (Issue #7) - Sound Effect Playback (Issue #8) Includes dependency graph, phased implementation order, acceptance criteria, and technical specifications.
This commit implements the complete Discord side of the RallyRound live speaker management system: ## Discord OAuth Provider (Issue #3) - GET /auth/discord - Initiate OAuth flow with CSRF protection - GET /auth/discord/callback - Exchange code for JWT token - GET /auth/validate - Validate tokens for RallyRound - GET /auth/user - Return authenticated user profile ## RallyRound API Client (Issue #4) - Full TypeScript client for RallyRound session API - Session, participant, signal, speaker, and agenda management - Error handling with retry logic for transient failures - Session registry to track active sessions per guild ## Bot Commands (Issue #5) - !rr prefix command system with parser - Session: start, end, pause, resume, status, link - Mode: structured/unstructured, record start/stop - Speaker: next, speaker @user, clear, queue - Signals: hand, point order/clarify/info, question, agree/disagree - Agenda: view, add, next, done, skip - Sound effects: on/off, list, play specific sound ## Voice Channel Presence Tracking (Issue #6) - Voice state event handler for join/leave/move - Automatic participant sync with RallyRound API - Bot joins voice channel when session starts - isUserInSessionVC permission check ## Webhook Receiver (Issue #7) - POST /webhooks/rallyround endpoint - HMAC-SHA256 signature verification - Timestamp validation (reject > 5 minutes old) - Handlers for: signal_raised, speaker_changed, mode_changed, recording_changed, agenda_advanced, session_ended ## Sound Effect Playback (Issue #8) - @discordjs/voice integration for audio playback - Per-session audio players with queue management - Signal-to-sound mapping - Playback queue to prevent overlapping
Migrate from message-based prefix commands to Discord's native slash command system using @discordjs/builders for better UX: - Add /rr slash command with subcommands for all functionality - Autocomplete, validation, and mobile-friendly interface - No custom parser needed - Discord handles it Slash command structure: - /rr start title:"Session Name" - Start session - /rr end, pause, resume, status, link - Session management - /rr mode mode:structured|unstructured - Change mode - /rr record action:start|stop - Recording control - /rr next, speaker user:@alice, clear, queue - Speaker management - /rr hand, point type:order|clarify|info, question - Signals - /rr agree, disagree, away, back - Status signals - /rr agenda, agenda-add, agenda-next, agenda-done - Agenda - /rr sfx action:on|off|list, sfx-play sound:chime - Sound effects Changes: - Create definitions.ts with SlashCommandBuilder definition - Create register.ts script to register commands with Discord - Move handlers to handlers/ subdirectory for organization - Update bot.ts to handle InteractionCreate instead of MessageCreate - Add npm run register-commands script Before using: Run `npm run register-commands` to register slash commands with Discord (may take up to an hour to appear).
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.
Summary
This PR implements the Discord side of the RallyRound live speaker management system, addressing Issues #3-8. It enables Discord users to participate in structured meetings with speaker queues, hand-raising, parliamentary signals, and real-time synchronization with the RallyRound web dashboard.
Key Features:
/rr) for all interactionsChanges
1. Discord OAuth Provider (Issue #3)
GET /auth/discord- Initiates OAuth flow with CSRF protectionGET /auth/discord/callback- Exchanges code for JWT token (24h expiry)GET /auth/validate- Validates tokens for RallyRound integrationGET /auth/user- Returns authenticated user profile2. RallyRound API Client (Issue #4)
3. Discord Slash Commands (Issue #5)
Native slash commands using
@discordjs/builders:/rr start title:"..."/rr end,pause,resume/rr mode mode:structured/rr record action:start/rr next,speaker user:@.../rr hand,point type:order/rr agree,disagree/rr agenda,agenda-add item:"..."/rr sfx action:on4. Voice Channel Presence Tracking (Issue #6)
voiceStateUpdateevents5. Webhook Receiver (Issue #7)
POST /webhooks/rallyroundendpointsignal_raised,speaker_changed,mode_changed,recording_changed,agenda_advanced,session_ended6. Sound Effect Playback (Issue #8)
@discordjs/voiceintegrationNew Dependencies
@discordjs/voice- Voice channel audiojsonwebtoken- JWT signing/verificationdrizzle-orm,better-sqlite3- Database (ready for future use)Environment Variables