diff --git a/cogs/refractor.py b/cogs/refractor.py index 08275fe..89436df 100644 --- a/cogs/refractor.py +++ b/cogs/refractor.py @@ -77,8 +77,8 @@ def format_refractor_entry(card_state: dict) -> str: track = card_state.get("track", {}) card_type = track.get("card_type", "batter") current_tier = card_state.get("current_tier", 0) - formula_value = card_state.get("current_value", 0) - next_threshold = card_state.get("next_threshold") + formula_value = int(card_state.get("current_value", 0)) + next_threshold = int(card_state.get("next_threshold") or 0) or None tier_label = TIER_NAMES.get(current_tier, f"T{current_tier}") formula_label = FORMULA_LABELS.get(card_type, card_type) @@ -107,11 +107,11 @@ def apply_close_filter(card_states: list) -> list: result = [] for state in card_states: current_tier = state.get("current_tier", 0) - formula_value = state.get("current_value", 0) + formula_value = int(state.get("current_value", 0)) next_threshold = state.get("next_threshold") if current_tier >= 4 or not next_threshold: continue - if formula_value >= 0.8 * next_threshold: + if formula_value >= 0.8 * int(next_threshold): result.append(state) return result