From 10f1f209da8f12fa5299d2910a3a2b8323a7202c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 15 Mar 2026 09:46:57 +0000 Subject: [PATCH 1/2] Initial plan From be0560dbf879d0b66c0ec0c78806a13cbef749bc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 15 Mar 2026 09:52:36 +0000 Subject: [PATCH 2/2] Change message when winning word is re-submitted after game is already won Co-authored-by: FlorentPoinsaut <1256948+FlorentPoinsaut@users.noreply.github.com> --- bot/bot.py | 5 ++++- tests/test_commands.py | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bot/bot.py b/bot/bot.py index 290c9e5..4af80d4 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -193,8 +193,11 @@ async def guess(self, ctx: commands.Context, word: str = "") -> None: await ctx.send("No game is currently in progress.") return - if result.is_found: + if result.is_found and not result.already_cited: await ctx.send(f"🎉 {ctx.author.name} found the word '{word}'!") + elif result.is_found and result.already_cited: + found_by = self._game_state.found_by + await ctx.send(f"🎉 The word '{word}' was already found by {found_by}!") elif result.already_cited: if result.entry.score is not None: pct = int(result.entry.score * 100) diff --git a/tests/test_commands.py b/tests/test_commands.py index 1e08d50..7c60c22 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -404,7 +404,7 @@ async def test_guess_already_cited_word_without_score_sends_distinct_message(sel assert "already" in message.lower() async def test_guess_exact_match_not_reported_as_already_cited(self): - """A winning guess should show the win message even if the word was cited before.""" + """Re-guessing the winning word after game is won should show an already-found message.""" bot = _make_bot(cooldown=0) bot._game_state = GameState(scorer=_FakeScorer()) bot._game_state.start_new_game("chat", Difficulty.EASY) @@ -417,9 +417,11 @@ async def test_guess_exact_match_not_reported_as_already_cited(self): ctx2.author.name = "bob" await _guess_fn(bot, ctx2, "chat") message = ctx2.send.call_args[0][0] - # Should show winner message, not "already cited" - assert "bob" in message.lower() + # Should show "already found by alice" message, not "already cited" or a new win + assert "alice" in message.lower() assert "chat" in message.lower() + assert "bob" not in message.lower() + # ---------------------------------------------------------------------------