Commit Graph

214 Commits

Author SHA1 Message Date
syntaxbullet
606d83a7ae feat: add health check command and tracking 2026-01-06 17:30:55 +01:00
syntaxbullet
3351295bdc feat: add database indexes for performance optimization 2026-01-06 17:26:34 +01:00
syntaxbullet
92cb048a7a test: fix mock leakage in db tests 2026-01-06 17:22:43 +01:00
syntaxbullet
6ead0c0393 feat: implement graceful shutdown handling 2026-01-06 17:21:50 +01:00
syntaxbullet
278ef4b6b0 fix: Normalize exam and cooldown dates to the start of the day for consistent calculations. 2026-01-05 17:36:53 +01:00
syntaxbullet
9a32ab298d feat: Implement a net worth leaderboard by aggregating user balance and inventory item values. 2026-01-05 16:40:26 +01:00
syntaxbullet
a2596d4124 docs: Add command reference and database schema documentation. 2026-01-05 13:13:46 +01:00
syntaxbullet
fbc8952e0a docs: Add guides for lootbox creation and configuration options. 2026-01-05 13:07:36 +01:00
syntaxbullet
d0b4cb80de feat: Add user existence checks to economy commands and refactor trade service to expose sessions for testing. 2026-01-05 12:57:22 +01:00
syntaxbullet
599684cde8 feat: Add lootbox item type with weighted rewards and dedicated UI for item usage results. 2026-01-05 12:52:34 +01:00
syntaxbullet
5606fb6e2f fix: Clarify daily claim cooldown message for daily claims. 2026-01-05 12:17:23 +01:00
syntaxbullet
fb260c5beb feat: Set daily claim cooldown to next UTC midnight and reset streak to 1 if missed by over 24 hours. 2026-01-05 12:10:41 +01:00
syntaxbullet
a227e5db59 feat: Implement graphical lootdrop cards for lootdrop and claimed messages. 2025-12-24 23:13:16 +01:00
syntaxbullet
66d5145885 docs: add guide for standard module structure patterns 2025-12-24 22:26:14 +01:00
syntaxbullet
2412098536 refactor(modules): standardize error handling in interaction handlers 2025-12-24 22:26:12 +01:00
syntaxbullet
d0c48188b9 refactor(core): centralize interaction error handling and organize routes 2025-12-24 22:26:10 +01:00
syntaxbullet
1523a392c2 refactor: add leveling view layer
Create leveling.view.ts with UI logic extracted from leaderboard command:
- getLeaderboardEmbed() for leaderboard display (XP and Balance)
- getMedalEmoji() helper for ranking medals (🥇🥈🥉)
- formatLeaderEntry() helper for entry formatting with null safety

Updated leaderboard.ts to use view functions instead of inline formatting.
2025-12-24 22:09:04 +01:00
syntaxbullet
7d6912cdee refactor: add quest view layer
Create quest.view.ts with UI logic extracted from quests command:
- getQuestListEmbed() for quest log display
- formatQuestRewards() helper for reward formatting
- getQuestStatus() helper for status display

Updated quests.ts to use view functions instead of inline embed building.
2025-12-24 22:08:55 +01:00
syntaxbullet
947bbc10d6 refactor: add inventory view layer
Create inventory.view.ts with UI logic extracted from commands:
- getInventoryEmbed() for inventory display
- getItemUseResultEmbed() for item use results

Updated commands with proper type safety:
- inventory.ts: add null check, convert user.id to string
- use.ts: add null check, convert user.id to string

Improves separation of concerns and type safety.
2025-12-24 22:08:51 +01:00
syntaxbullet
2933eaeafc refactor: convert TradeService to object export pattern
Convert from class-based to object-based export for consistency with
other services (economy, inventory, quest, etc).

Changes:
- Move sessions Map and helper functions to module scope
- Convert static methods to object properties
- Update executeTrade to use withTransaction helper
- Update all imports from TradeService to tradeService

Updated files:
- trade.service.ts (main refactor)
- trade.interaction.ts (update usages)
- trade.ts command (update import and usage)

All tests passing with no breaking changes.
2025-12-24 21:57:30 +01:00
syntaxbullet
77d3fafdce refactor: standardize transaction pattern in class.service.ts
Replace manual transaction handling with withTransaction helper pattern
for consistency with other services (economy, inventory, quest, leveling).

Also fix validation bug in modifyClassBalance:
- Before: if (balance < amount)
- After: if (balance + amount < 0n)

This correctly validates negative amounts (debits) to prevent balances
going below zero.
2025-12-24 21:57:14 +01:00
syntaxbullet
10a760edf4 refactor: replace console.* with logger in core lib files
Update loaders, handlers, and BotClient to use centralized logger:
- CommandLoader.ts and EventLoader.ts
- AutocompleteHandler.ts, CommandHandler.ts, ComponentInteractionHandler.ts
- BotClient.ts

Provides consistent formatting across all core library logging.
2025-12-24 21:56:50 +01:00
syntaxbullet
a53d30a0b3 feat: add centralized logger utility
Add logger.ts with consistent emoji prefixes for all log levels:
- info, success, warn, error, debug

This provides a single source of truth for logging and enables
future extensibility for file logging or external services.
2025-12-24 21:56:29 +01:00
syntaxbullet
5420653b2b refactor: Extract interaction handling logic into dedicated ComponentInteractionHandler, AutocompleteHandler, and CommandHandler classes. 2025-12-24 21:38:01 +01:00
syntaxbullet
f13ef781b6 refactor(lib): simplify BotClient using loader classes
- Delegate command loading to CommandLoader
- Delegate event loading to EventLoader
- Remove readCommandsRecursively and readEventsRecursively methods
- Remove isValidCommand and isValidEvent methods (moved to loaders)
- Add summary logging with load statistics
- Export Client class for better type safety
- Reduce file from 188 to 97 lines (48% reduction)

BREAKING CHANGE: Client class is now exported as a named export
2025-12-24 21:32:23 +01:00
syntaxbullet
82a4281f9b feat(lib): extract EventLoader from BotClient
- Create dedicated EventLoader class for event loading logic
- Implement recursive directory scanning
- Add event validation and registration (once vs on)
- Improve error handling with structured results
- Enable better testability and separation of concerns
2025-12-24 21:32:15 +01:00
syntaxbullet
0dbc532c7e feat(lib): extract CommandLoader from BotClient
- Create dedicated CommandLoader class for command loading logic
- Implement recursive directory scanning
- Add category extraction from file paths
- Add command validation and config-based filtering
- Improve error handling with structured results
- Enable better testability and separation of concerns
2025-12-24 21:32:08 +01:00
syntaxbullet
953942f563 feat(lib): add loader types for command/event loading
- Add LoadResult interface to track loading statistics
- Add LoadError interface for structured error reporting
- Foundation for modular loader architecture
2025-12-24 21:31:54 +01:00
syntaxbullet
6334275d02 refactor: modernize transaction patterns and improve type safety
- Refactored user.service.ts to use withTransaction() helper
- Added 14 comprehensive unit tests for user.service.ts
- Removed duplicate user creation in interactionCreate.ts
- Improved type safety in interaction.routes.ts
2025-12-24 21:23:58 +01:00
syntaxbullet
f44b053a10 feat: add admin moderation commands for managing cases, warnings, and notes. 2025-12-24 21:02:37 +01:00
syntaxbullet
fe58380d58 fix: Add null check for regex capture group and non-null assertion for type safety. 2025-12-24 20:59:10 +01:00
syntaxbullet
64cf47ee03 feat: add moderation module with case tracking database schema 2025-12-24 20:55:56 +01:00
syntaxbullet
37ac0ee934 feat: implement message pruning command with dedicated service and UI components. 2025-12-24 20:45:40 +01:00
syntaxbullet
5ab19bf826 fix: improve feedback type parsing from custom IDs and add validation for feedback types in interaction and view logic. 2025-12-24 20:23:52 +01:00
syntaxbullet
42d2313933 feat: Introduce a comprehensive feedback system with a slash command, interactive UI, and configuration. 2025-12-24 20:16:47 +01:00
syntaxbullet
cddd8cdf57 refactor: move terminal message and channel ID persistence from a dedicated file to the main application configuration. 2025-12-24 19:57:00 +01:00
syntaxbullet
eaaf569f4f feat: Implement cumulative XP leveling system with new helper functions and update XP bar to show progress within the current level. 2025-12-24 18:52:40 +01:00
syntaxbullet
8c28fe60fc feat: Enable Components V2, use user mentions, and enhance transaction log display in terminal service. 2025-12-24 18:07:50 +01:00
syntaxbullet
6d725b73db feat: Add MessageFlags.IsComponentsV2 to terminal message updates and remove redundant SectionBuilder wrappers. 2025-12-24 17:54:56 +01:00
syntaxbullet
da048eaad1 fix: Update Discord.js message edit property from containers to components for layout. 2025-12-24 17:47:53 +01:00
syntaxbullet
56da4818dc feat: Refactor terminal message to use new Discord.js UI builders for structured output. 2025-12-24 17:43:56 +01:00
syntaxbullet
ca443491cb refactor: Remove backticks and square brackets from terminal activity timestamp. 2025-12-24 17:26:40 +01:00
syntaxbullet
345e05f821 feat: Introduce dynamic Aurora Observatory terminal with admin command, scheduled updates, and lootdrop event integration. 2025-12-24 17:19:22 +01:00
syntaxbullet
419059904c refactor: relocate interaction routes from events to lib directory 2025-12-24 14:36:14 +01:00
syntaxbullet
7698a3abaa chore: delete test-student-id.png 2025-12-24 14:30:50 +01:00
syntaxbullet
83984faeae feat: Configure app service to restart automatically in Docker Compose and replace file-based restart trigger with process.exit(). 2025-12-24 14:28:23 +01:00
syntaxbullet
2106f06f8f chore: remove student id testing script 2025-12-24 14:23:55 +01:00
syntaxbullet
16d507991c feat: Enhance update requirements check to include database migrations and rename related interfaces and methods. 2025-12-24 14:17:02 +01:00
syntaxbullet
e2aa5ee760 feat: Implement stateful admin update with post-restart context, database migrations, and dedicated view components. 2025-12-24 14:03:15 +01:00
syntaxbullet
e084b6fa4e refactor: Reorganize admin update flow to prepare restart context before update and explicitly trigger restart. 2025-12-24 13:50:37 +01:00