How vivek09-bit/wbot-python works
This is a Flask webhook bot that turns incoming WhatsApp messages into DeepSeek-backed replies. Meta verifies the webhook, then posts messages; the server validates signatures, de-duplicates and acknowledges events before processing each message on a worker thread. That flow handles commands, read receipts, bounded conversation history, model errors, and replies split and sent through Meta. The README also documents health/status endpoints and configurable credentials and runtime behavior. Source excerpts show the main calls; optional persistence is only a production suggestion, not an implemented subsystem.
Main entry points: app.py Flask webhook · llm.py DeepSeek client · whatsapp.py WhatsApp client · config.py Validated settings
Components 14
Webhook ingress
- Flask webhook
app.py - Webhook verification
app.py - Signature validation
app.py - Message de-duplication
bot/memory.py
Conversation handling
- Message dispatch
app.py - Chat commands
app.py - Conversation history
bot/memory.py
External integrations
- DeepSeek client
bot/llm.py - WhatsApp client
bot/whatsapp.py
Runtime support
- Validated settings
bot/config.py - Service and health endpoints
app.py
Other components
- WhatsApp user
- Meta Cloud API
- DeepSeek API
Connections 15
- WhatsApp user → Meta Cloud API: sends message
README.md - Meta Cloud API → Flask webhook: posts webhook
README.md - Meta Cloud API → Webhook verification: verifies webhook
README.md - Flask webhook → Signature validation: validates signature
app.py - Flask webhook → Message de-duplication: checks message ID
app.py - Flask webhook → Message dispatch: starts worker
app.py - Message dispatch → Chat commands: handles commands
app.py - Message dispatch → Conversation history: reads and updates
app.py - Message dispatch → DeepSeek client: requests reply
app.py - DeepSeek client → DeepSeek API: requests completion
bot/llm.py - Message dispatch → WhatsApp client: sends read and reply
app.py - WhatsApp client → Meta Cloud API: posts messages
bot/whatsapp.py - WhatsApp user → Meta Cloud API: receives reply
README.md - Validated settings → Flask webhook: configures runtime
app.py - Flask webhook → Service and health endpoints: serves status
app.py