Conversation
Adds a self-contained imc module: /imc record stores weight/height and computes BMI (ephemeral reply), /imc view shows a member's BMI (ephemeral), /imc leaderboard lists server members by descending BMI (public). Includes ImcEntry Prisma model, French/English translations, unit tests, and functional documentation. Co-Authored-By: Claude Code <noreply@anthropic.com>
The leaderboard no longer sorts by raw BMI descending: entries are ranked by deviation from the healthy range (18.5-25, WHO normal), with ties broken by BMI in the sort direction. A new order option selects worst-first (default) or best-first, and each row shows the deviation. Pure ranking logic (distanceToIdeal, rankEntries) is unit tested. Co-Authored-By: Claude Code <noreply@anthropic.com>
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.
What
New self-contained
imcmodule (auto-discovered, no registration needed outside its directory):/imc record <weight> <height>— stores weight/height, computes BMI, replies ephemerally with BMI (1 decimal) + WHO category/imc view [target]— shows a member's BMI (self by default), ephemeral/imc leaderboard [limit]— server ranking by BMI descending (default 10, max 25), public replySupporting pieces:
ImcEntryPrisma model (one entry per member/guild via@@unique([guildId, userId])),ImcService(upsert / lookup / ordered query), FR + EN translations (displayed as "IMC" / "BMI"), 12 unit tests, and adocs/functional.mdsection.Why
Requested feature: let users record their BMI and generate a leaderboard sorted by descending BMI.
Privacy design:
record/vieware ephemeral (health data visible only to the requester); onlyleaderboardis public — members opt in by recording their BMI. Command/subcommand names stay in English with French localized descriptions, per the repo's command convention.Verification
pnpm build(tsc) passes, full unit suite 116/116 green,oxlintcleanReviewer notes / follow-up
P1001onlocalhost:5432), so rundocker compose up -d && pnpm prisma:migrate -- --name add_imc_entrywith the DB up before merging/using./modules.🤖 Generated with Claude Code