Commit Graph

4 Commits

Author SHA1 Message Date
Chris Ham
46b78dd6b3 Add reaction-based status feedback for prefix SFX commands
- Implement reaction progression: 🔊 (playing) →  (finished)
- Remove permissions-heavy removeAll() call that was causing errors
- Add error reaction () for failed sound playback
- Fallback to text reply if reactions fail (permission handling)
- Maintain clean chat experience with minimal visual feedback

Status Flow:
- !sfx command starts: 🔊 reaction added
- Sound finishes playing:  reaction added (both visible)
- Error occurs:  reaction added

Now all SFX interfaces provide consistent status feedback:
- Prefix: Reaction-based progression
- Slash commands: Ephemeral message updates

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 22:05:20 -07:00
Chris Ham
aaf33d55db CHECKPOINT: Interactive soundboard and refactored SFX system
Major Features Implemented:
- Complete Discord.js v14 modernization from v12 with hybrid command system
- SQLite database for dynamic guild configuration management
- Interactive soundboard with categorized button interface (/soundboard)
- Three-tier SFX interface: prefix (!sfx), autocomplete (/sfx), and visual soundboard
- Auto-registration system for public bot distribution
- Soft delete guild management preserving configurations

Technical Improvements:
- Refactored SFX playing into reusable service methods (playSFXInteraction/playSFXMessage)
- Smart markdown chunking that respects code block boundaries
- High-performance caching for 275+ sound effects with autocomplete optimization
- Modern Discord.js v14 patterns (MessageFlags.Ephemeral, proper intents)
- Fixed security vulnerability in @discordjs/opus with pnpm overrides
- Docker deployment with Node 20 and npm for reliable SQLite compilation

Interactive Soundboard Features:
- Category-based navigation with buttons (GENERAL, NERDS, TWIN PEAKS, etc.)
- Pagination support for large categories (16 sounds per page, 4 per row)
- Real-time status updates (Playing → Finished playing)
- Navigation buttons (Previous/Next/Back to Categories)
- Ephemeral responses for clean chat experience

Database System:
- Auto-migration from config.json to SQLite on first run
- /config slash commands for live server configuration
- Scheduled events with timezone support (object and cron formats)
- Guild auto-registration with welcome messages for new servers

Current State: Fully functional modern Discord bot ready for public distribution
2025-08-16 16:20:02 -07:00
Chris Ham
0b167aaa35 Add high-performance caching for SFX autocomplete
- Pre-sort SFX names at startup for efficient autocomplete
- Add search result caching with Map for instant repeated queries
- Respect Discord's 25-choice autocomplete limit
- Cache invalidation when SFX directory changes
- Optimize for 275+ sound effects with minimal latency

Performance improvements:
- Autocomplete responses now cached and instant
- No file system access during user interactions
- Memory-efficient search result caching

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 15:21:50 -07:00
Chris Ham
0ad4265bed Modernize Discord bot to v14 and Node.js 22
Major upgrades and architectural improvements:
- Upgrade Discord.js from v12 to v14.21.0
- Upgrade Node.js from 14 to 22 LTS
- Switch to pnpm package manager
- Complete rewrite with modern Discord API patterns

New Features:
- Hybrid command system: prefix commands + slash commands
- /sfx slash command with autocomplete for sound discovery
- Modern @discordjs/voice integration for audio
- Improved voice connection management
- Enhanced logging for SFX commands
- Multi-stage Docker build for optimized images

Technical Improvements:
- Modular architecture with services and command handlers
- Proper intent management for Discord gateway
- Better error handling and logging
- Hot-reload capability maintained
- Environment variable support
- Optimized Docker container with Alpine Linux

Breaking Changes:
- Moved main entry from index.js to src/index.js
- Updated configuration structure for v14 compatibility
- Replaced deprecated voice APIs with @discordjs/voice
- Updated audio dependencies (opus, ffmpeg)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 11:37:37 -07:00