Skip to content

bot event system#1

Draft
jackharrhy wants to merge 14 commits intomainfrom
feature/bot-event-system
Draft

bot event system#1
jackharrhy wants to merge 14 commits intomainfrom
feature/bot-event-system

Conversation

@jackharrhy
Copy link
Member

  • 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
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.

1 participant