How febbadityan/impostor-wabot works
This repository is a WhatsApp Impostor word-game bot. Players register and create or join a room, start a game, receive private roles and a clue word, take turns giving clues, and vote; the bot announces the outcome. The map separates WhatsApp connection and message handling from game rules and persisted game state. README documentation is brief, so the guide supplies the documented game stages; the heavily obfuscated game module limits certainty about its internal details.
Main entry points: index.js Bot connection · impostor/index.js Game API · handler.js Command handler · function.js Game rules
Components 9
WhatsApp runtime
- Bot connection
index.js - Message adapter
src/myfunc.js - Command handler
handler.js
Game interaction
- Game API
src/impostor/index.js - Game rules
src/impostor/lib/function.js - Game guide
src/impostor/guide.js
Game state
- Game data
src/impostor/lib/db
Other components
- Players
Connections 9
- Players → WhatsApp: send commands
README.md - WhatsApp → Bot connection: deliver messages
index.js - Bot connection → Message adapter: serialize messages
index.js - Bot connection → Command handler: dispatch messages
index.js - Bot connection → WhatsApp: connect and reply
index.js - Command handler → Game API: invoke game actions
handler.js - Game API → Game rules: re-export functions
src/impostor/index.js - Game API → Game guide: re-export guide
src/impostor/index.js - Game rules → Game data: read and write
src/impostor/lib/function.js