Draft
Conversation
Member
jackharrhy
commented
Mar 4, 2026
- refactor: restructure as importable Python package
- feat: add StackCoin WebSocket gateway client, replace polling
- Create luckypot/ package with game.py, db.py, stk.py, config.py - Extract game logic from lucky_pot.py into luckypot/game.py - lucky_pot.py becomes thin Discord runner importing from package - Root db.py/stk.py/config.py become backward-compat re-exports - Fix instant-win entries counted in pot status - Add has_pending_instant_wins(), get_entry_by_request_id() - Add bot balance check before sending winnings - Update pyproject.toml with hatchling build system
- Add luckypot/gateway.py with StackCoinGateway class - Phoenix Channel protocol: connect, join, heartbeat, event dispatch - Auto-reconnect with 5s backoff on connection failure - Event replay via last_event_id on reconnect - Wire gateway into lucky_pot.py main()
…w interval mode - Only announce pot entries to the channel after payment is confirmed, not on /enter-pot - Entry announcements now show pot size and prompt others to /enter-pot - Add dramatic staged draw reveal (send → edit → edit) for all draw types - Fix announce_fn wiring: resolve guild_id from DB instead of event payload - Persist gateway last_event_id to DB so restarts resume without replaying - Update WebSocket URL from /socket/websocket to /ws - Use gateway ws_url config directly instead of deriving from API URL - Add BRAND_COLOR constant for consistent purple UI theming - Add draw_interval_minutes config to override daily schedule for testing - Extract shared next_draw_time() so /pot-status reflects interval mode
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.