Open
Conversation
- Implements core utility functions for leaderboard - Uses Redis cache for persistency - Global leaderboard, daily global leaderboard, a specific user's points & admin clear command - Implements the coin flip game for testing the leaderboard - Uses the duck coin image shown in the issue
with coinflip = 2 as baseline
rf20008
reviewed
Feb 28, 2026
rf20008
reviewed
Feb 28, 2026
rf20008
reviewed
Feb 28, 2026
rf20008
reviewed
Feb 28, 2026
rf20008
left a comment
There was a problem hiding this comment.
I think you've made some good progress so far. However, I have given you some feedback.
Now if points are clamped due to daily limit, the real value is shown instead of the constants. Updates all 14 games to use this new value.
jchristgit
reviewed
Mar 1, 2026
Member
jchristgit
left a comment
There was a problem hiding this comment.
All in all, looks really solid! I have a few improvement suggestions, but in general the design is sound, the implementation is sound, and the Python Discord Hive Mind is satisfied with your offering.
Co-authored-by: Jacob Christensen <jc@jchri.st>
Co-authored-by: Jacob Christensen <jc@jchri.st>
Co-authored-by: Jacob Christensen <jc@jchri.st>
the function leaderboard_me now invokes leaderboard_user with user=ctx.author
winner variable is now simply set to response.author
4 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relevant Issues
Closes #627
Description
This PR implements the Global Leaderboard feature (Issue #627). It creates a unified scoring system across all fun and holiday games in the bot.
The persistent global scores are stored in
Leaderboard.points_cache(aRedisCachewith namespace"leaderboard:points"), which maintains user totals indefinitely across all games. The daily point tracking uses raw Redis keys with the patternleaderboard:daily:{user_id}:{game_name}, each with a TTL set to expire at UTC midnight viaseconds_until_midnight_utc(). Whenadd_points()is called, it first checks the daily key to enforce the 100-point cap per game, then atomically updates the persistent global cache.Core Implementation
.leaderboard, .lb)..leaderboard me,.leaderboard user @Member)..leaderboard today).!leaderboard clear).Visuals
Followed preferences from old closed PR, such as using the duck coin & using medals for top 3.
Game Integrations (Added
add_pointscalls)All integrated games now display a
(+X pts)message when winning to provide user feedback.Did you: