26 Commits

Author SHA1 Message Date
Chris Ham
8823eac094 Convert to database-first configuration with token storage
- Rename config.json → seed.json to clarify seeding purpose
- Update ConfigManager to be database-first with minimal file fallbacks
- Store Discord token in database instead of environment variables
- Remove allowedSfxChannels functionality completely
- Update seeding script to import token from seed.json to database
- Add token field to bot_config table in database schema
- Update Docker volume mount to use seed.json
- Update gitignore to protect seed.json while allowing seed.example.json

Configuration Flow:
1. First run: Import from seed.json to database (one-time seeding)
2. Runtime: All configuration from SQLite database
3. Fallback: Environment variables if database unavailable

Security: All sensitive data now stored in encrypted SQLite database

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 23:37:06 -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
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
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
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
abdc894359 dockerize 2024-02-27 18:27:31 -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
7b92e139a7 - support event scheduling
- upgrade discordjs and associated packages
- add/edit some sfx
2021-04-02 22:06:23 -07: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
greenham
b1d3114921 upgrade discord packages 2020-05-10 17:24:18 -07:00
Chris Ham
5c2b2a6ef3 remove unused packages 2020-05-01 17:52:21 -07:00
Chris Ham
68d8d67fc5 remove old fgfm code, general cleanup 2020-05-01 17:27:06 -07:00
Chris Ham
11ccf684b5 normalize and compress all sfx, read sfx list from pastebin 2020-02-29 06:59:24 -08:00
Chris Ham
13594f7e3a update packages, add knob 2019-05-15 08:18:01 -07:00
Chris Ham
51f417b916 wip 2018-11-14 09:05:45 -08:00
Chris Ham
9a24f4b522 big refactor 2018-10-01 21:10:06 -07:00
Chris Ham
2dad2a3bc5 room vids 2018-09-25 20:24:32 -07:00
Chris Ham
5dbc673669 automation wip 2018-09-13 17:37:34 -07:00
Chris Ham
950ad92364 automation wip 2018-09-13 15:51:30 -07:00
Chris Ham
3e1874ce4d new sfx and some obs integration 2018-09-10 21:02:25 -07:00
Chris Ham
4ad54f427b fix some packages 2018-08-19 07:53:51 -07:00
Chris Ham
94c6049e44 updated bot commands, new sfx 2018-02-01 09:54:56 -08:00
Chris Ham
a2a9974108 support for ankhbot commands, static commands, cooldowns, implemented fun/ham facts 2018-01-22 18:32:09 -08:00
Chris Ham
9a0a0dae15 new sfx and timers 2017-08-03 07:41:30 -07:00
Chris Ham
8790469dc8 initial commit for sfx functionality 2017-07-14 08:27:18 -07:00