Overview
Bridge external chat platforms (Twitch, Discord, Telegram) into the game so live stream audiences can interact with the AI game master and players.
Scope
- Chat bridge service that relays messages from external platforms to `POST /api/chat/bridge`
- Twitch integration via `tmi.js`
- Discord integration via `discord.js`
- Telegram integration via `node-telegram-bot-api`
- SSE stream at `/api/stream/events` relays game events back to platforms
- Rate limiting to prevent spam (configurable cooldowns)
- Audience messages displayed in-game with platform badge (Twitch/Discord/Telegram icon)
Reference
A reference implementation exists in `chat-bridge.js` — it handles all three platforms with configurable environment variables. The `/api/chat/bridge` endpoint accepts `{ sender, message, platform, senderType }`.
Notes
Each platform integration is optional — the bridge works with any combination of platforms enabled.
Overview
Bridge external chat platforms (Twitch, Discord, Telegram) into the game so live stream audiences can interact with the AI game master and players.
Scope
Reference
A reference implementation exists in `chat-bridge.js` — it handles all three platforms with configurable environment variables. The `/api/chat/bridge` endpoint accepts `{ sender, message, platform, senderType }`.
Notes
Each platform integration is optional — the bridge works with any combination of platforms enabled.