Command Registration
Commands are registered globally or per-guild using Discord’s application commands API. The registration happens in/apps/discord-bot/src/commands/register.ts.
Global Commands
Available in all servers where the bot is installed.Guild Commands
Restricted to specific servers (currently the Answer Overflow debug server).Solution Management
✅ Mark Solution
Context menu command to mark a message as the solution to a question. Type: Message Context Menu CommandPermission Check: Must be question author OR have ManageThreads, ManageChannels, ManageGuild, or Administrator permission How to Use:
- Right-click a message in a thread
- Select “Apps” > ”✅ Mark Solution”
- The message will be marked as the solution
- Message is marked as solution in database
- Checkmark (✅) reaction added to both question and solution messages
- Solution tag added to forum thread (if configured)
- Question tag removed from forum thread (if configured)
- Thread archived (if server settings enable auto-archive)
- Thread locked (if server settings enable auto-lock)
- Leaderboard points awarded to solution author
- Analytics event tracked
- Must be used in a thread
- Channel must have mark solution enabled
- Cannot mark the question message as its own solution
/apps/discord-bot/src/commands/mark-solution.ts:36
✅ Mark Solution & Archive
Same as “Mark Solution” but always archives the thread after marking, regardless of server settings. Type: Message Context Menu CommandPermission Check: Same as “Mark Solution”
Response: Ephemeral (only visible to you)
Community Commands
/leaderboard
Display the server leaderboard showing who has solved the most questions. Type: Slash CommandPermission Check: None Options:
Show the leaderboard only to you (default: false)
- Top 10 users by solutions marked
- Each user’s solution count
- User avatars and names
- Link to full leaderboard on web
/apps/discord-bot/src/commands/leaderboard.ts
/export
Export a channel or thread’s messages to a file. Type: Slash CommandPermission Check: None Options:
Export format. Choices:
markdown- Export as Markdown file (default)json- Export as JSON file
Only show the export to you (default: true)
/apps/discord-bot/src/commands/export.ts
Server Management
/channel-settings
Open the Answer Overflow dashboard to configure channel settings. Type: Slash CommandPermission Check: Requires ManageGuild permission Response: Sends an ephemeral message with a link to the dashboard settings page for the server. Example:
- Enable/disable indexing per channel
- Enable/disable mark solution feature
- Configure solution tag for forum channels
- Set tags to remove when solution is marked
- Configure auto-archive on solution
- Configure auto-lock on solution
/apps/discord-bot/src/commands/channel-settings.ts
/manage-account
Manage how Answer Overflow interacts with your Discord account. Type: Slash CommandPermission Check: None Response: Sends an ephemeral message with options to:
- View your privacy settings
- Hide your messages from public indexing
- Opt out of leaderboards
- Delete your Answer Overflow data
- Link to privacy policy
Feedback & Support
/feedback
Send feedback about Answer Overflow to the development team. Type: Slash CommandPermission Check: None
Context: Works in servers and DMs Response: Opens a modal dialog where you can enter feedback text. Submissions are sent to the Answer Overflow team. Example:
/apps/discord-bot/src/commands/feedback.ts
/bug-report
Report a bug with Answer Overflow. Type: Slash CommandPermission Check: None
Context: Works in servers and DMs Response: Opens a modal dialog for submitting bug reports with fields for:
- Bug title
- Description
- Steps to reproduce
- Expected vs actual behavior
/apps/discord-bot/src/commands/bug-report.ts
Developer Commands
These commands are only available in the Answer Overflow debug server (Guild ID: 1037547185492996207)./debug
Test bot latency and API status. Type: Slash CommandPermission Check: Rhys only
Availability: Debug server only Response: Displays:
- Bot WebSocket latency
- API response time
- Database connection status
- Current bot version
/apps/discord-bot/src/commands/debug.ts
Context Menu Commands
Quick Action
Multi-purpose context menu for common actions. Type: Message Context Menu CommandPermission Check: Varies by action Available Actions:
- Delete message (if you’re the author or have permissions)
- Report message
- Bookmark message
- Copy message link
- Right-click a message
- Select “Apps” > “Quick Action”
- Choose an action from the menu
/apps/discord-bot/src/interactions/quick-action.ts
Create GitHub Issue
Create a GitHub issue from a Discord thread. Type: Message Context Menu CommandPermission Check: Requires GitHub integration to be configured for the server How to Use:
- Right-click the first message in a thread
- Select “Apps” > “Create GitHub Issue”
- Fill in the issue details in the modal
- Creates a GitHub issue with the thread content
- Links the Discord thread to the GitHub issue
- Posts a message in the thread with the issue link
- Server must have GitHub integration enabled
- User must have connected their GitHub account
- Server must have a configured GitHub repository
/apps/discord-bot/src/commands/github-issue-utils.ts
Command Error Handling
All commands implement comprehensive error handling:Command Timeouts
Commands have a 25-second timeout to prevent hung interactions:- An error is logged with context (guild, channel, user)
- The user sees an error message
- The interaction is cleaned up
Permissions Reference
Discord Permissions Used
- ManageThreads - Close/archive threads, mark solutions in any thread
- ManageChannels - Mark solutions in any thread
- ManageGuild - Access channel settings, server configuration
- Administrator - Full access to all bot features
Permission Checking
Analytics & Tracking
Commands fire analytics events for:- Command usage (which command was used)
- Success/failure outcomes
- Solution marking events
- Export format preferences
- Error occurrences
- PostHog for user behavior analytics
- Custom Convex functions for database events
- Discord audit log for moderation actions