CodeGrind-Team / CodeGrind-Bot

Elevate your LeetCode experience with CodeGrind Bot: Compete on leaderboards, retrieve LeetCode problems, and track your progress! 🚀
https://top.gg/bot/1059122559066570885
Other
17 stars 9 forks source link

Track users number of wins for each leaderboard timeframe within each server #160

Open Kevin-Roman opened 5 months ago

Kevin-Roman commented 5 months ago

Description

This feature was removed in the development and migration to the entirely different MongoDB schema that took place in May 2024. This feature could be re-implemented, this time more efficiently, and with extra features.

Potential solution

  1. Rename the Preferences document to something more appropriate such as "UserServerData".
  2. Move all preference fields into a new "Preferences" basemodel.
  3. Create a Wins basemodel that has fields for each type of leaderboard (except all-time as a win system isn't appropriate for that).
  4. Update document if user wins for a specific leaderboard in a server.
  5. Create logic to sort based on wins, and create new command param.
  6. Migrate to the new schema.
Kevin-Roman commented 3 months ago

Tracking win counts has been implemented, however doesn't seem to be working in prod. A PR to hopefully address this issue has been deployed to prod.