diff --git a/wordle.py b/wordle.py index 6c6ed59..cccf4fa 100644 --- a/wordle.py +++ b/wordle.py @@ -538,6 +538,7 @@ async def wordle_guess( if all(s == 2 for s in result): game.finished = True game.won = True + origin = game.origin_room_id _record_game_result(sender, game) del _active_games[sender] @@ -547,9 +548,7 @@ async def wordle_guess( plain = ( f"{congrats} Wordle {game.daily_number} {num}/6" f"{'*' if game.hard_mode else ''}\n\n" - f"{grid_plain}\n\n" - f"Use {BOT_PREFIX}wordle stats for your statistics " - f"or {BOT_PREFIX}wordle share to share!" + f"{grid_plain}" ) grid_html = render_grid_html(game) mode = "*" if game.hard_mode else "" @@ -557,17 +556,18 @@ async def wordle_guess( f'' f"{congrats} " f"Wordle {game.daily_number} {num}/6{mode}

" - f"{grid_html}
" - f"Use {BOT_PREFIX}wordle stats for statistics " - f"or {BOT_PREFIX}wordle share to share!" + f"{grid_html}" ) await send_html(client, room_id, plain, html) + if origin and origin != room_id: + await wordle_share(client, origin, sender) return # Check loss (6 guesses used) if len(game.guesses) >= 6: game.finished = True game.won = False + origin = game.origin_room_id _record_game_result(sender, game) del _active_games[sender] @@ -590,6 +590,8 @@ async def wordle_guess( f"Better luck tomorrow!" ) await send_html(client, room_id, plain, html) + if origin and origin != room_id: + await wordle_share(client, origin, sender) return # Still playing — show grid + keyboard @@ -692,6 +694,7 @@ async def wordle_give_up(client: AsyncClient, room_id: str, sender: str): game.finished = True game.won = False + origin = game.origin_room_id _record_game_result(sender, game) del _active_games[sender] @@ -711,6 +714,8 @@ async def wordle_give_up(client: AsyncClient, room_id: str, sender: str): f"Better luck tomorrow!" ) await send_html(client, room_id, plain, html) + if origin and origin != room_id: + await wordle_share(client, origin, sender) # --------------------------------------------------------------------------- @@ -757,9 +762,7 @@ async def handle_wordle( # All other commands route through DM dm_room, origin = await _get_dm_room(client, room_id, sender) - # Notify the public room if we're redirecting to a DM - if dm_room != room_id: - await send_text(client, room_id, "\U0001f4ec Check your DMs to play Wordle!") + # Silently redirect to DM — origin room will get an auto-share when the game ends if subcmd == "help": await wordle_help(client, dm_room)