feat(wordgame): inactivity timeout, per-player bonus guesses, DM opt-out#187
Merged
Conversation
10 min of no guesses ends the game, regardless of player state. Timer resets on every valid guess. Task starts when a game begins, stops when no active games remain — no idle polling.
…sses Players who have used all their guesses gain one more every 5 minutes. The background task already runs for inactivity — it now also fires bonus grants on schedule and notifies the thread. Scoreboard shows when the next bonus lands.
Each player's 5-min bonus countdown starts from their own last guess, not a shared game clock. Bonus notification is sent as a DM with a Stop DMs button (ignore:thread_id:user_id). Clicking it sets ignore_dms=True for that player/game — no further DMs. Scoreboard shows each done player's personal bonus countdown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #184 — adds inactivity-based auto-close, per-player bonus guesses, and a DM re-engagement system with opt-out.
Changes
INACTIVITY_TIMEOUT = 600): game auto-closes after 10 minutes of no guesses. Every valid guess resets the clock. Countdown shown in the scoreboard header.BONUS_GUESS_INTERVAL = 300): 5 minutes after a player uses their last guess, they gain +1 more. Each player's timer is independent. Scoreboard shows personal countdown per done player.BonusDMView): bonus notification is sent as a DM with a 🚫 Stop DMs button. Clicking it setsignore_dms = True— no further DMs for that game.Testing
python -m py_compile wordgame/*.py✅flake8 wordgame/ --max-line-length=100✅