OpenWA
OpenWA copied to clipboard
feat(message): add human-like typing simulation
Description
Add human-like typing simulation to message sending. Messages now show a typing indicator with configurable speed before delivery, making automated messages feel more natural.
Features
- HumanizeService with configurable typing speeds:
slow— 2.5 chars/secnormal— 4.5 chars/secfast— 6.5 chars/sec
- Typing indicator via
chat.sendStateTyping()with periodic refresh - Post-typing hesitation (200ms buffer before send)
- Max delay cap at 70 seconds
- Bulk message support with per-message typing delays
- Dashboard toggle in MessageTester with speed selector
API Usage
POST /api/sessions/:id/messages/send-text
{
"chatId": "[email protected]",
"text": "Hello!",
"humanize": {
"enabled": true,
"speed": "slow"
}
}
Type of Change
- [x] New feature
Checklist
- [x] Tests added/updated
- [x] Lint passes
- [x] Self-reviewed