From 94f3b1dc975903bfab0c656791b81d5281467c53 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Thu, 26 Mar 2026 13:04:19 -0500 Subject: [PATCH] fix: apply open-packs hotfix to cogs/economy.py Port the Check-In Player pack fix from the hotfix branch to the legacy economy.py cog (which production currently loads instead of economy_new). - Filter auto-open pack types from the manual open-packs menu - Add pretty_name fallback for hyphenated pack type names - Add ruff noqa for pre-existing star import warnings Co-Authored-By: Claude Opus 4.6 (1M context) --- cogs/economy.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cogs/economy.py b/cogs/economy.py index ebb4058..3baecf4 100644 --- a/cogs/economy.py +++ b/cogs/economy.py @@ -1,3 +1,4 @@ +# ruff: noqa: F403, F405 import copy import helpers @@ -695,6 +696,9 @@ class Economy(commands.Cog): ) return + # Pack types that are auto-opened and should not appear in the manual open menu + AUTO_OPEN_TYPES = {"Check-In Player"} + # Group packs by type and customization (e.g. Standard, Standard-Orioles, Standard-2012, Premium) p_count = 0 p_data = { @@ -711,6 +715,11 @@ class Economy(commands.Cog): p_group = None logger.debug(f"pack: {pack}") logger.debug(f"pack cardset: {pack['pack_cardset']}") + if pack["pack_type"]["name"] in AUTO_OPEN_TYPES: + logger.debug( + f"Skipping auto-open pack type: {pack['pack_type']['name']}" + ) + continue if pack["pack_team"] is None and pack["pack_cardset"] is None: p_group = pack["pack_type"]["name"] # Add to p_data if this is a new pack type @@ -773,6 +782,9 @@ class Economy(commands.Cog): pretty_name = f"{key.split('-')[0]} - {key.split('-')[3]}" elif "Cardset" in key: pretty_name = f"{key.split('-')[0]} - {key.split('-')[3]}" + else: + # Pack type name contains a hyphen (e.g. "Check-In Player") + pretty_name = key if pretty_name is not None: embed.add_field(name=pretty_name, value=f"Qty: {len(p_data[key])}")