From 1f26020bd7db14c8764f3afc0f70c91ea03ec675 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Mon, 23 Mar 2026 10:39:56 -0500 Subject: [PATCH] fix: move TIER_BADGES to module level and fix unknown tier fallback - TIER_BADGES dict moved from inside get_card_embeds() to module level - Unknown tiers now show no badge instead of silently promoting to [SF] Co-Authored-By: Claude Opus 4.6 (1M context) --- helpers/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/helpers/main.py b/helpers/main.py index 9581032..72f0922 100644 --- a/helpers/main.py +++ b/helpers/main.py @@ -23,6 +23,9 @@ from utils import ( from search_utils import * from discord_utils import * +# Refractor tier badge prefixes for card embeds (T0 = no badge) +TIER_BADGES = {1: "BC", 2: "R", 3: "GR", 4: "SF"} + async def get_player_photo(player): search_term = player["bbref_id"] if player["bbref_id"] else player["p_name"] @@ -115,8 +118,8 @@ async def get_card_embeds(card, include_stats=False) -> list: evo_state = await db_get(f"evolution/cards/{card['id']}") if evo_state and evo_state.get("current_tier", 0) > 0: tier = evo_state["current_tier"] - TIER_BADGES = {1: "BC", 2: "R", 3: "GR", 4: "SF"} - tier_badge = f"[{TIER_BADGES.get(tier, 'SF')}] " + badge = TIER_BADGES.get(tier) + tier_badge = f"[{badge}] " if badge else "" except Exception: pass