Skip to content

feat(wordgame): inactivity timeout, per-player bonus guesses, DM opt-out#187

Merged
psykzz merged 3 commits into
mainfrom
feature/wordgame-mechanics
Jun 22, 2026
Merged

feat(wordgame): inactivity timeout, per-player bonus guesses, DM opt-out#187
psykzz merged 3 commits into
mainfrom
feature/wordgame-mechanics

Conversation

@psykzz

@psykzz psykzz commented Jun 22, 2026

Copy link
Copy Markdown
Owner

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 (INACTIVITY_TIMEOUT = 600): game auto-closes after 10 minutes of no guesses. Every valid guess resets the clock. Countdown shown in the scoreboard header.
  • Per-player bonus guesses (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.
  • DM opt-out (BonusDMView): bonus notification is sent as a DM with a 🚫 Stop DMs button. Clicking it sets ignore_dms = True — no further DMs for that game.

Testing

  • python -m py_compile wordgame/*.py
  • flake8 wordgame/ --max-line-length=100

psykzz added 3 commits June 22, 2026 23:30
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.
@psykzz psykzz added the enhancement New feature or request label Jun 22, 2026
@psykzz psykzz self-assigned this Jun 22, 2026
@psykzz psykzz merged commit 8e14f93 into main Jun 22, 2026
3 checks passed
@psykzz psykzz deleted the feature/wordgame-mechanics branch June 22, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant