Skip to content

- Add LeaderboardModule and integrate it with ModuleManager.#180

Merged
bristermitten merged 10 commits into
TheDeveloperDen:masterfrom
Pdzly:feature/bump-leaderboards
Oct 23, 2025
Merged

- Add LeaderboardModule and integrate it with ModuleManager.#180
bristermitten merged 10 commits into
TheDeveloperDen:masterfrom
Pdzly:feature/bump-leaderboards

Conversation

@Pdzly

@Pdzly Pdzly commented Oct 19, 2025

Copy link
Copy Markdown
Contributor
  • 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.

Pdzly added 4 commits October 19, 2025 13:00
- 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.
@bristermitten

Copy link
Copy Markdown
Member

@Pdzly the tests not compiling needs to be fixed please

@bristermitten bristermitten left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a great start! but a few changes needed please

Comment thread src/modules/core/bump.listener.ts
Comment thread src/modules/core/bump.listener.ts Outdated
Comment thread src/modules/leaderboard/leaderboard.ts
Comment thread src/modules/leaderboard/leaderboard.ts
Comment thread src/modules/leaderboard/leaderboard.command.ts Outdated
@bristermitten
bristermitten requested a review from Copilot October 20, 2025 08:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/modules/leaderboard/leaderboard.command.ts Outdated
Comment thread src/modules/core/bump.listener.ts Outdated
Pdzly added 3 commits October 21, 2025 18:45
- Extract user retrieval into reusable helper functions for better readability.
- Improve aggregation handling for bump-related leaderboards.
- Apply consistent formatting across the module.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/modules/leaderboard/leaderboard.module.ts Outdated
Comment on lines +22 to +24
: sql`"DDUser"
.
"bumps"`;

Copilot AI Oct 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
: sql`"DDUser"
.
"bumps"`;
: sql`"DDUser"."bumps"`;

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bristermitten our linting does this automatically.

Comment thread src/modules/core/bump.listener.ts Outdated
Comment thread src/modules/leaderboard/leaderboard.command.ts
Pdzly and others added 3 commits October 22, 2025 18:38
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.
@bristermitten
bristermitten merged commit 278c3ce into TheDeveloperDen:master Oct 23, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants