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
syntaxbullet
3f6da16f89
feat: Add post-update dependency installation, refactor restart logic, and update completion messages.
2025-12-24 13:46:32 +01:00
syntaxbullet
71de87d3da
chore: Remove migration generation command from update service.
2025-12-24 13:43:04 +01:00
syntaxbullet
fc7afd7d22
feat: implement a dedicated update service to centralize bot update logic, dependency checks, and post-restart handling.
2025-12-24 13:38:45 +01:00
syntaxbullet
fcc82292f2
feat: Introduce modular inventory item effect handling and centralize Discord interaction routing.
2025-12-24 12:20:42 +01:00
syntaxbullet
f75cc217e9
refactor: extract further UI components into views
2025-12-24 11:44:43 +01:00
syntaxbullet
5c36b9be25
refactor: Extract UI component creation into new view files for lootdrop, trade, item wizard, and enrollment.
2025-12-24 11:36:19 +01:00
syntaxbullet
eaf97572a4
refactor: replace direct EmbedBuilder usage with a new createBaseEmbed helper for consistent embed creation
2025-12-24 11:17:59 +01:00
syntaxbullet
1189483244
refactor: clean up unused imports and dead code across commands, services, and tests.
2025-12-24 11:02:13 +01:00
syntaxbullet
f39ccee0d3
fix: Cast user ID to string for member fetching
2025-12-24 10:07:51 +01:00
syntaxbullet
10282a2570
feat: Add admin command to create color roles and corresponding shop items.
2025-12-23 21:56:45 +01:00
syntaxbullet
a3099b80c5
feat: Add color role item effect with role swapping and implement item consumption toggle.
2025-12-23 21:12:36 +01:00
syntaxbullet
67d6298793
revert(pay): ping in separate message content due to API limitations
2025-12-23 18:50:35 +01:00
syntaxbullet
808fbef11b
fix: allow included mentions on payment
2025-12-23 18:44:17 +01:00
syntaxbullet
b833796fb9
fix: make payments public
2025-12-23 18:42:13 +01:00
syntaxbullet
58ea8b92f1
fix: timestamp rendering issues
2025-12-23 18:36:22 +01:00
syntaxbullet
fbd2bd990f
fix: correct Discord timestamp formatting in daily command
2025-12-22 14:32:33 +01:00
syntaxbullet
f859618367
feat: introduce weekly bonus for daily rewards, updating calculations, configuration, and command UI.
2025-12-22 13:16:44 +01:00
syntaxbullet
b7b1dd87b8
style: Standardize template literal spacing and remove extraneous markdown code block delimiters.
2025-12-22 13:08:35 +01:00