Commit Graph

142 Commits

Author SHA1 Message Date
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
greenham
34b86fff09 update sfx code to match new discord API 2020-05-10 17:25:06 -07:00
greenham
fb7aaa5c84 new sfx 2020-05-10 17:24:35 -07:00
greenham
1ac1cc4278 upgrade discord packages 2020-05-10 17:24:27 -07:00
greenham
b1d3114921 upgrade discord packages 2020-05-10 17:24:18 -07:00
greenham
b5da012a34 ignore todo files 2020-05-10 17:24:03 -07:00
Chris Ham
5c2b2a6ef3 remove unused packages 2020-05-01 17:52:21 -07:00
Chris Ham
acc5630e42 Merge branch 'master' of github.com:greenham/ghbot
* 'master' of github.com:greenham/ghbot:
  support blacklisting users
2020-05-01 17:49:21 -07:00