Skip to content

Show "already found" message when winning word is re-submitted after game is won#35

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/change-message-if-word-found
Draft

Show "already found" message when winning word is re-submitted after game is won#35
Copilot wants to merge 2 commits intomainfrom
copilot/change-message-if-word-found

Conversation

Copy link
Contributor

Copilot AI commented Mar 15, 2026

When a player submitted the winning word after another player had already won, the bot incorrectly credited the late submitter as the winner ("🎉 bob found the word 'chat'!"). The message must be distinct when the game is already won.

Changes

  • bot/bot.py: Split the result.is_found branch on already_cited to differentiate a genuine win from a re-submission of the already-found word:

    # Genuine win (first correct guess)
    if result.is_found and not result.already_cited:
        await ctx.send(f"🎉 {ctx.author.name} found the word '{word}'!")
    # Game already won — re-submission of winning 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}!")
  • tests/test_commands.py: Updated test_guess_exact_match_not_reported_as_already_cited to assert the new behaviour — the message credits the original winner (alice), not the late submitter (bob).

Original prompt

This section details on the original issue you should resolve

<issue_title>Change message if the word has already been found</issue_title>
<issue_description></issue_description>

<agent_instructions>If the game ils win, the message must be different</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…y won

Co-authored-by: FlorentPoinsaut <1256948+FlorentPoinsaut@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix message when word has already been found Show "already found" message when winning word is re-submitted after game is won Mar 15, 2026
Copilot AI requested a review from FlorentPoinsaut March 15, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change message if the word has already been found

2 participants