From 1e75f1babaad856300fdd0e4e71bed7993f00c4c Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Mon, 10 Nov 2025 09:17:55 -0600 Subject: [PATCH] CLAUDE: Add news-ticker message when gauntlet runs end with 2 losses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Users reported that end-of-run messages to #pd-news-ticker were no longer appearing when gauntlet teams lost their second game. The news-ticker announcement was only happening for 10-win completions, not 2-loss endings. Changes: - Updated end_run() to accept bot and main_team parameters - Added send_to_channel() call when losses == 2 (natural run end) - Skips news-ticker for manual resets (force_end=True) - Updated post_result() to pass bot and main_team to end_run() - Updated manual reset calls to explicitly pass force_end=True Now when a gauntlet team loses their second game, #pd-news-ticker will show: "The **[Team]** have completed their **[Event]** Gauntlet run with a final record of [wins]-[losses]." The draft completion message to news-ticker was already working correctly at cogs/players_new/gauntlet.py:178-183. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- cogs/players.py | 2 +- cogs/players_new/gauntlet.py | 2 +- gauntlets.py | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cogs/players.py b/cogs/players.py index 14e8570..a0aafd8 100644 --- a/cogs/players.py +++ b/cogs/players.py @@ -1068,7 +1068,7 @@ class Players(commands.Cog): await view.wait() if view.value: - await gauntlets.end_run(this_run, this_event, draft_team) + await gauntlets.end_run(this_run, this_event, draft_team, force_end=True) await interaction.edit_original_response( content=f'Your {event_name} run has been reset. Run `/gauntlets start {event_name}` to redraft!', view=None diff --git a/cogs/players_new/gauntlet.py b/cogs/players_new/gauntlet.py index 03b76de..1889c83 100644 --- a/cogs/players_new/gauntlet.py +++ b/cogs/players_new/gauntlet.py @@ -222,7 +222,7 @@ class Gauntlet(commands.Cog): await view.wait() if view.value: - await gauntlets.end_run(this_run, this_event, draft_team) # type: ignore + await gauntlets.end_run(this_run, this_event, draft_team, force_end=True) # type: ignore await interaction.edit_original_response( content=f'Your {event_name} run has been reset. Run `/gauntlets start` to redraft!', view=None diff --git a/gauntlets.py b/gauntlets.py index 2c0696e..0421d4f 100644 --- a/gauntlets.py +++ b/gauntlets.py @@ -1838,7 +1838,7 @@ async def get_embed(this_run=None, this_event=None, this_team=None): return embed -async def end_run(this_run, this_event, this_team: Team, force_end: bool = False): +async def end_run(this_run, this_event, this_team: Team, bot=None, main_team=None, force_end: bool = False): l_message = f'Tough loss. That brings your {this_event["name"]} record to ' \ f'**{this_run["wins"]}-{this_run["losses"]}**. ' if this_run['losses'] == 2 or force_end: @@ -1850,6 +1850,16 @@ async def end_run(this_run, this_event, this_team: Team, force_end: bool = False ) c_query = await db_post(f'cards/wipe-team/{this_team.id}') + # Send news-ticker message for natural run completion (2 losses), not for manual resets + if bot and main_team and this_run['losses'] == 2 and not force_end: + team_name = main_team.lname if isinstance(main_team, Team) else main_team.get('lname', 'Unknown Team') + await send_to_channel( + bot, + 'pd-news-ticker', + content=f'The **{team_name}** have completed their **{this_event["name"]} Gauntlet** run ' + f'with a final record of {this_run["wins"]}-{this_run["losses"]}.' + ) + return l_message @@ -2004,7 +2014,7 @@ async def post_result(run_id: int, is_win: bool, this_team: Team, bot, channel, params=[('losses', this_run['losses'] + 1)] ) - l_message = await end_run(this_run, this_event, this_team) + l_message = await end_run(this_run, this_event, this_team, bot, main_team) await channel.send( content=l_message, embed=await get_embed(this_run)