Commit Graph

149 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
98ed84aa2b Fix reboot command configuration reference
- Update reboot command to use ConfigManager instead of raw config
- Fix broken adminUserId reference that was causing command errors
- Use getBotConfig() method to properly access admin configuration
- Ensure reboot command works with hybrid database/file config system

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 21:50:35 -07:00
Chris Ham
bcefe03c50 Remove allowedSfxChannels functionality - allow SFX in all channels
- Remove allowedSfxChannels from database schema and all code
- Remove channel checking logic from all SFX commands (!sfx, /sfx, /soundboard)
- Remove /config sfxchannels subcommand
- Update config.json and example to remove channel restrictions
- Simplify SFX system to work in any channel with bot access

Benefits:
- Better user experience - no confusing channel restrictions
- Simpler configuration - fewer settings to manage
- Cleaner codebase - reduced complexity
- Universal access - SFX works anywhere the bot can send messages

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 21:45:42 -07:00
Chris Ham
e9b3b630b6 Add smart contextual autocomplete for admin role management
- Add autocomplete to /config roles add/remove commands
- /config roles add only shows roles not currently self-assignable
- /config roles remove only shows roles currently self-assignable
- Filter out bot roles, @everyone, and unmanageable roles
- Convert role parameter to string with autocomplete for better UX
- Add role name validation and lookup in config command

Admin Experience Improvements:
- Smart role suggestions prevent duplicate/invalid selections
- No more seeing roles already in the self-assignable list
- Only see roles the bot can actually manage
- Clean, focused autocomplete interface

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 21:05:46 -07:00
Chris Ham
efd5472eed Add smart contextual autocomplete for role management
- Add context-aware autocomplete for /role add and /role remove commands
- /role add only shows roles user doesn't have that are self-assignable
- /role remove only shows roles user currently has that are self-manageable
- Filter autocomplete based on user input with 25 result limit
- Convert role options from RoleOption to StringOption with autocomplete
- Prevent users from seeing irrelevant role choices

User Experience Improvements:
- Smart role suggestions based on current user state
- No more trying to add roles you already have
- No more seeing roles you can't manage
- Clean, focused autocomplete interface

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 20:49:01 -07:00
Chris Ham
3c8e005405 Fix role configuration database persistence issue
- Fix /config roles add/remove commands not saving to database
- Prevent upsertGuildConfig from overwriting direct database role updates
- Add early return for role management to skip general config update
- Ensure role IDs are properly persisted when using /config roles commands
- Add proper success feedback and logging for role configuration changes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 20:33:43 -07:00
Chris Ham
61a376cfbb Modernize role management system with slash commands and role IDs
- Convert role management from prefix to slash commands (/role add/remove/list)
- Update database schema to store role IDs as JSON arrays instead of regex patterns
- Add /config roles command for administrators to manage allowed roles
- Simplify database schema by reusing allowed_roles_for_request field as JSON
- Add database reset script (pnpm reset-db) for easy testing and migration
- Update config format to only support array format (no backward compatibility)

Role Management Features:
- /role add <role> - Self-assign roles with dropdown selection
- /role remove <role> - Remove roles with dropdown selection
- /role list - Show available self-assignable roles
- /config roles add/remove/list/clear - Administrator role management

Technical Improvements:
- Role ID based matching (more reliable than name-based regex)
- Type-safe role selection with Discord's native role picker
- Permission hierarchy validation
- Rich embed responses with proper error handling
- Ephemeral responses for clean chat experience

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 18:07:07 -07:00
Chris Ham
18350ee878 Consolidate soundboard categories and improve layout
- Merge all people categories (JOSH, LANX, MUTT, etc.) into NERDS section
- Consolidate TV & movie categories into single TV & MOVIES section
- Maintain alphabetical order within all sections
- Update soundboard to show 4 categories per row for cleaner layout
- Remove verbose category list from soundboard interface
- Add emojis to category headers for better visual appeal

Soundboard now shows:
- 🔉 GENERAL - Common/utility sounds
- 🤓 NERDS - Gaming, streaming, and personality sounds
- 🎥 TV & MOVIES - All show/movie clips combined
- Clean 4-button layout per row

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 16:47:59 -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
c3adb66de8 Improve SFX list formatting and add smart markdown chunking
- Add smart chunking logic that respects markdown block boundaries
- Prevent code blocks from being split across Discord messages
- Update SFX list display to use improved README.md formatting
- Ensure proper markdown rendering in Discord chat

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 15:13:43 -07:00
Chris Ham
f8147ffb14 formatting 2025-08-16 15:02:06 -07:00
Chris Ham
bc74978a79 Update to modern Discord.js ephemeral message pattern
- Replace ephemeral: true with flags: [MessageFlags.Ephemeral]
- Add MessageFlags import to Discord.js imports
- Update all slash command error responses to use modern flag syntax
- Maintains same functionality with Discord.js v14 best practices

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 15:01:49 -07:00
Chris Ham
437206851b Update SFX list and improve display functionality
- Update sfx/README.md to include all 275 sound files with proper categorization
- Organize missing sounds into appropriate categories (SILICON VALLEY, KING OF THE HILL, etc.)
- Fix SFX list display to use local README.md instead of external URL
- Add fallback to auto-generated list if README is missing
- Improve chunking to prevent Discord character limit errors

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 14:54:40 -07:00
Chris Ham
80b21e5073 Fix security vulnerability with pnpm override
- Add pnpm override to replace vulnerable @discordjs/opus with opusscript
- Eliminates CVE-2024-21521 Denial of Service vulnerability (CVSS 8.7)
- Maintains API compatibility while using secure implementation
- Security audit now shows: No known vulnerabilities found

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 14:26:49 -07:00
Chris Ham
fd68a02503 Update CLAUDE.md to reflect current SQLite database architecture
- Document SQLite database system with table structures
- Update commands to match package.json scripts (start, stop, boom, etc.)
- Add comprehensive database configuration flow documentation
- Document auto-registration system for public bot distribution
- Update Docker setup details (Node 20, npm usage, persistence)
- Add guild management and soft delete system documentation
- Document hybrid configuration system (database + file fallback)
- Update architecture with all new services and components

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 14:21:24 -07:00
Chris Ham
c2962bac16 Update README.md with SQLite database documentation
- Document database-driven configuration system
- Add three configuration approaches (auto-registration, live config, seeding)
- Update Docker commands to match package.json scripts
- Add comprehensive scheduled events documentation with timezone support
- Update architecture diagram to include database components
- Clarify Node.js version requirements (20 for Docker, 22+ local)
- Document migration process from config.json to database

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 14:12:21 -07:00
Chris Ham
d74aebfda7 Add SQLite database for dynamic guild management
Features:
- SQLite database with better-sqlite3 for guild configurations
- Auto-registration when bot joins new guilds with welcome messages
- Soft delete system preserves settings when bot is removed
- Dynamic configuration via /config slash command with subcommands
- Automatic migration from config.json to database on first run
- Support for scheduled events with timezone preservation

Technical Implementation:
- Node.js 20 for better SQLite compatibility in Docker
- Full Debian base image with npm for reliable native module compilation
- Database persistence via Docker volume (./data)
- Hybrid configuration system (database primary, file fallback)
- JSON storage for complex schedule objects with timezone support

Database Schema:
- guilds table with soft delete (is_active flag)
- scheduled_events table with JSON schedule storage
- bot_config table for global settings
- Auto-initialization and seeding from existing config

Admin Features:
- /config show - View current server settings
- /config subcommands - Update prefix, volume, features, etc.
- Administrator permissions required for configuration changes
- Graceful handling of missing or malformed data

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 14:02:27 -07:00
Chris Ham
9661ba92d5 Add Docker Compose setup and clean up legacy code
- Add docker-compose.yml with volume mounts for config/sfx
- Simplify npm scripts (up/down/build/restart/logs)
- Update README.md and CLAUDE.md with new commands
- Remove unused lib/ directory (migrated to src/)
- Update package.json scripts to cleaner naming

Benefits:
- Update configs and sound effects without rebuilding image
- Simplified Docker workflow management
- Cleaner project structure

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 12:06:40 -07:00
Chris Ham
e53360e887 gen readme 2025-08-16 11:43:46 -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
Chris Ham
19c8f4fa85 output next invocation time for scheduled jobs 2024-02-28 16:43:29 -08:00
Chris Ham
abdc894359 dockerize 2024-02-27 18:27:31 -08:00
Chris Ham
30f8307551 new sfx 2023-12-26 13:03:30 -08:00
Chris Ham
194d74f4e7 Merge branch 'main' of github.com:greenham/ghbot
* 'main' of github.com:greenham/ghbot:
  Bump node-fetch from 2.6.1 to 2.6.7
  Bump follow-redirects from 1.14.7 to 1.14.8
  Bump axios from 0.21.1 to 0.21.2
  Bump follow-redirects from 1.13.3 to 1.14.7
2023-12-26 13:02:22 -08:00
Chris Ham
0528e71ad8 new sfx 2023-12-26 13:00:09 -08:00
greenham
fa70efaa98 Merge pull request #8 from greenham/dependabot/npm_and_yarn/node-fetch-2.6.7
Bump node-fetch from 2.6.1 to 2.6.7
2022-02-16 07:47:24 -08:00
dependabot[bot]
313ca7c677 Bump node-fetch from 2.6.1 to 2.6.7
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-16 15:46:04 +00:00
greenham
2ac5050284 Merge pull request #7 from greenham/dependabot/npm_and_yarn/follow-redirects-1.14.8
Bump follow-redirects from 1.14.7 to 1.14.8
2022-02-16 07:45:30 -08:00
dependabot[bot]
30d660ad7a Bump follow-redirects from 1.14.7 to 1.14.8
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 12:58:19 +00:00
greenham
b7a72f6792 Merge pull request #6 from greenham/dependabot/npm_and_yarn/axios-0.21.2
Bump axios from 0.21.1 to 0.21.2
2022-01-14 16:22:02 -08:00
dependabot[bot]
8730b90039 Bump axios from 0.21.1 to 0.21.2
Bumps [axios](https://github.com/axios/axios) from 0.21.1 to 0.21.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.21.1...v0.21.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-15 00:21:34 +00:00
greenham
76403d3821 Merge pull request #5 from greenham/dependabot/npm_and_yarn/follow-redirects-1.14.7
Bump follow-redirects from 1.13.3 to 1.14.7
2022-01-14 16:20:41 -08:00
dependabot[bot]
67fc7edbb5 Bump follow-redirects from 1.13.3 to 1.14.7
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.13.3 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.13.3...v1.14.7)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-14 09:26:03 +00:00
greenham
ca00e52377 use correct argument when reporting invalid group 2021-08-10 20:03:31 -07:00
greenham
01cc04f0b2 better error handling 2021-08-06 09:04:05 -07:00
greenham
aa83901435 new sfx 2021-08-06 08:57:30 -07:00
greenham
60db93dd2d remove dead clip 2021-08-06 08:57:23 -07:00
greenham
2b3027c496 handle role requests 2021-08-06 08:57:16 -07:00
greenham
7b92e139a7 - support event scheduling
- upgrade discordjs and associated packages
- add/edit some sfx
2021-04-02 22:06:23 -07:00
greenham
6bf997e3be - new location for sfx list due to pastebin restrictions
- new sfx
2021-04-02 19:49:00 -07:00
Chris Ham
48be847d08 new sfx 2021-01-21 07:45:30 -08:00
greenham
75809a310a Merge pull request #4 from greenham/dependabot/npm_and_yarn/socket.io-2.4.1
Bump socket.io from 2.3.0 to 2.4.1
2021-01-21 07:43:43 -08:00
greenham
f87d40948f Merge pull request #3 from greenham/dependabot/npm_and_yarn/axios-0.21.1
Bump axios from 0.19.2 to 0.21.1
2021-01-21 07:43:32 -08:00
greenham
21d9ed8602 Merge pull request #1 from greenham/dependabot/npm_and_yarn/node-fetch-2.6.1
Bump node-fetch from 2.6.0 to 2.6.1
2021-01-21 07:43:22 -08:00
greenham
3f3da329b4 Merge pull request #2 from greenham/dependabot/npm_and_yarn/ini-1.3.8
Bump ini from 1.3.5 to 1.3.8
2021-01-21 07:43:09 -08:00
dependabot[bot]
416f258f00 Bump socket.io from 2.3.0 to 2.4.1
Bumps [socket.io](https://github.com/socketio/socket.io) from 2.3.0 to 2.4.1.
- [Release notes](https://github.com/socketio/socket.io/releases)
- [Changelog](https://github.com/socketio/socket.io/blob/2.4.1/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io/compare/2.3.0...2.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-21 15:10:41 +00:00
dependabot[bot]
c2a0d955c3 Bump axios from 0.19.2 to 0.21.1
Bumps [axios](https://github.com/axios/axios) from 0.19.2 to 0.21.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.21.1/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.19.2...v0.21.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-06 02:19:16 +00:00
dependabot[bot]
680ece01a4 Bump ini from 1.3.5 to 1.3.8
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-12 17:10:51 +00:00
dependabot[bot]
39d8230355 Bump node-fetch from 2.6.0 to 2.6.1
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-12 21:19:24 +00:00