diff --git a/cogs/players_new/evolution.py b/cogs/players_new/evolution.py index 902fd24..b831084 100644 --- a/cogs/players_new/evolution.py +++ b/cogs/players_new/evolution.py @@ -174,6 +174,7 @@ class Evolution(commands.Cog): # Apply "close" filter client-side if progress and progress.lower() == "close": items = [s for s in items if is_close_to_tierup(s)] + total_count = len(items) if not items: await interaction.followup.send( "No cards are close to a tier-up right now.", diff --git a/command_logic/logic_gameplay.py b/command_logic/logic_gameplay.py index 4b782e9..c7d4e67 100644 --- a/command_logic/logic_gameplay.py +++ b/command_logic/logic_gameplay.py @@ -23,6 +23,7 @@ from helpers import ( position_name_to_abbrev, team_role, ) +from helpers.evolution_notifs import notify_tier_completion from in_game.ai_manager import get_starting_lineup from in_game.game_helpers import PUBLIC_FIELDS_CATEGORY_NAME, legal_check from in_game.gameplay_models import ( @@ -4242,24 +4243,6 @@ async def get_game_summary_embed( return game_embed -async def notify_tier_completion(channel: discord.TextChannel, tier_up: dict) -> None: - """Stub for WP-14: log evolution tier-up events. - - WP-14 will replace this with a full Discord embed notification. For now we - only log the event so that the WP-13 hook has a callable target and the - tier-up data is visible in the application log. - - Args: - channel: The Discord channel where the game was played. - tier_up: Dict from the evolution API, expected to contain at minimum - 'player_id', 'old_tier', and 'new_tier' keys. - """ - logger.info( - f"[WP-14 stub] notify_tier_completion called for channel={channel.id if channel else 'N/A'} " - f"tier_up={tier_up}" - ) - - async def complete_game( session: Session, interaction: discord.Interaction, diff --git a/helpers/main.py b/helpers/main.py index b879ea1..9043e4b 100644 --- a/helpers/main.py +++ b/helpers/main.py @@ -2,6 +2,8 @@ import asyncio import datetime import logging import math + +logger = logging.getLogger("discord_app") import os import random import traceback @@ -132,7 +134,7 @@ async def get_card_embeds(card, include_stats=False) -> list: tier = evo_state["current_tier"] tier_badge = f"[{'EVO' if tier >= 4 else f'T{tier}'}] " except Exception: - logging.warning( + logger.warning( f"Could not fetch evolution state for card {card.get('id')}; " "displaying without tier badge.", exc_info=True, diff --git a/tests/test_card_embed_evolution.py b/tests/test_card_embed_evolution.py index 5a3b9e2..2aabb7e 100644 --- a/tests/test_card_embed_evolution.py +++ b/tests/test_card_embed_evolution.py @@ -158,7 +158,6 @@ class TestCardEmbedTierBadge: returns, then call get_card_embeds() and inspect the resulting embed title. """ - @pytest.mark.asyncio @pytest.mark.asyncio async def test_no_evolution_state_shows_plain_name(self): """