- Add LeaderboardModule and integrate it with ModuleManager.#180
Conversation
Pdzly
commented
Oct 19, 2025
- Refactor and enhance leaderboard command to support additional types, including Weekly Bumps with aggregation.
- Improve bump streak handling logic in BumpListener.
- Reformat code for consistency and readability across multiple modules.
- Refactor and enhance leaderboard command to support additional types, including Weekly Bumps with aggregation. - Improve bump streak handling logic in BumpListener. - Reformat code for consistency and readability across multiple modules.
…ure/bump-leaderboards # Conflicts: # src/modules/xp/xp.module.ts
- Change leaderboard posting schedule to Mondays at 6 AM. - Apply consistent formatting to enhance code readability.
|
@Pdzly the tests not compiling needs to be fixed please |
bristermitten
left a comment
There was a problem hiding this comment.
a great start! but a few changes needed please
There was a problem hiding this comment.
Pull Request Overview
This PR creates a new LeaderboardModule and refactors the existing leaderboard functionality to support additional types including Weekly Bumps with database aggregation. The changes also improve bump streak handling logic and address code formatting inconsistencies.
- Extracted leaderboard functionality from XpModule into a dedicated LeaderboardModule
- Added Weekly Bumps leaderboard type with SQL aggregation for better performance
- Enhanced bump streak detection and notification logic in BumpListener
- Fixed code formatting and improved type safety across multiple files
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/store/storage.ts | Added DDUser-Bump association for database relationships |
| src/store/models/bumps.ts | Improved streak extraction logic with better null safety |
| src/modules/xp/xp.module.ts | Removed LeaderboardCommand to separate concerns |
| src/modules/leaderboard/leaderboard.ts | New utility functions for aggregated bump queries |
| src/modules/leaderboard/leaderboard.module.ts | New module definition for leaderboard functionality |
| src/modules/leaderboard/leaderboard.listener.ts | Automated weekly leaderboard posting |
| src/modules/leaderboard/leaderboard.command.ts | Enhanced command with aggregation support and new bump types |
| src/modules/core/bump.listener.ts | Improved bump detection and streak handling |
| src/index.ts | Registered LeaderboardModule with ModuleManager |
| src/config.type.ts | Added leaderboard channel configuration |
| src/Config.ts | Added leaderboard channel ID |
| src/Config.prod.ts | Added empty line for formatting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Extract user retrieval into reusable helper functions for better readability. - Improve aggregation handling for bump-related leaderboards. - Apply consistent formatting across the module.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| : sql`"DDUser" | ||
| . | ||
| "bumps"`; |
There was a problem hiding this comment.
The SQL fragment is split across multiple lines with unusual formatting. This should be written on a single line as sql"DDUser"."bumps"` for better readability and consistency with the rest of the codebase.
| : sql`"DDUser" | |
| . | |
| "bumps"`; | |
| : sql`"DDUser"."bumps"`; |
There was a problem hiding this comment.
@bristermitten our linting does this automatically.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Enhance aggregation handling with `useAggregation` flag for improved clarity. - Simplify bump listener by removing redundant command type checks. - Apply consistent formatting to leaderboard-related modules.
…feature/bump-leaderboards