Inspiration
Twitch chat loves deciding things together, but channel-point redemptions are one person, one click. Chai Pot Live is the live-stream spin-off of Chai Pot, a group wallet where shared money follows rules the group sets. On stream, the money is imaginary chai leaves and the group is chat.
What it does
Chai Pot Live is an OBS browser-source overlay plus a chat game:
- !chip adds leaves to a shared pot (per-viewer limit per session).
- !propose suggests what the pot should brew for the streamer. Policy checks run instantly: amount under the streamer's cap, enough in the pot, proposer has chipped in. A failing proposal is rejected on screen with the failed rule named.
- !vote yes|no (or !yes / !no): only viewers who chipped can vote, one vote each. Enough yes votes before the countdown ends and the proposal brews, with a celebration; otherwise it expires.
- Mods and the broadcaster can !veto or !brew.
- The overlay shows an animated chai pot filling up, top chippers, proposal cards with vote bars and countdown rings, the rules strip, a live chat strip and an event feed. State persists per channel.
- The streamer configures channel, cap, votes needed, voting window and per-viewer limit on a setup page that builds the overlay URL (with optional transparent background and a clearly labelled DEMO mode with simulated viewers).
How it connects to Twitch
It reads Twitch chat anonymously over Twitch IRC on WebSocket (wss://irc-ws.chat.twitch.tv, justinfan nick, tags capability), so a streamer needs no login, tokens or backend: paste the overlay URL into OBS and chat drives it. Badges and the mod tag decide who can veto or force-brew; display-name colors from tags style the chat strip; chat text is always escaped.
How I used Codex
I built it entirely with OpenAI Codex CLI, signed in with my ChatGPT account. One Codex session (01a1892d-5311-74f0-8b20-22de9d12c3b1) scaffolded the Vite + TypeScript project from an empty folder, wrote the IRC parser, the pure game reducer with policy checks, the overlay UI and Vitest tests, ran npm test and npm run build, fixed a failing test itself, and committed. I then resumed the same session to add the live chat strip, a deterministic 60-second demo story and setup toggles, with new tests. 21 tests pass and the production build is green. The video shows a replay of that session log, then the overlay connected to a real live channel (#shroud) with real chat flowing.
Challenges
Keeping the game fair and deterministic with chat noise: the reducer is pure (state, event, time), so votes, expiry and caps are fully unit-tested. Staying safe with untrusted chat: no raw HTML, only escaped text.
What's next
EventSub channel-point rewards as the leaf source, a Twitch Extension panel version, and per-stream summaries ("chat brewed 3 things tonight").
Built With
- obs
- openai-codex
- twitch
- typescript
- vercel
- vite
- vitest
Log in or sign up for Devpost to join the conversation.