WP-12: Tier Badge on Card Embed #77
Labels
No Label
ai-changes-requested
ai-failed
ai-merged
ai-pr-opened
ai-reviewed
ai-reviewing
ai-reviewing
ai-working
bug
enhancement
evolution
performance
phase-0
phase-1a
phase-1b
phase-1c
phase-1d
security
tech-debt
todo
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-database#77
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Modify
get_card_embeds()in the bot to show a tier badge prefix in the card title when a card has evolution progress. E.g.[T2] Mike Trout,[EVO] Mike Troutfor T4.Repo:
discord-app(code in bot repo, tracked here for milestone)Phase: 1c (Bot Integration)
Dependencies: WP-07
Complexity: S
Implementation
Must be wrapped in try/except — API failure must NOT break card display.
Tests (write first in
discord-app/tests/test_card_embed_evolution.py)Plan reference:
docs/prd-evolution/PHASE1_PROJECT_PLAN.mdWP-12PR opened in the discord-app repo: cal/paper-dynasty-discord#88
Approach: Added 9 lines to
get_card_embeds()inhelpers/main.py— fetchesevolution/cards/{card_id}, computes the badge string ([T1]–[T3]or[EVO]), and prepends it to the embed title. The whole fetch is intry/except Exception: passso any API failure is silent.Also added
ruff.tomlto suppress legacy star-import/bare-except rules that were blocking the pre-commit hook (hook was installed afterhelpers/main.pylast committed).11 unit tests in
tests/test_card_embed_evolution.pycover all specified scenarios.