OpenWA icon indicating copy to clipboard operation
OpenWA copied to clipboard

feat(message): add human-like typing simulation

Open abdelrahmanmegaly-jpg opened this issue 6 months ago • 0 comments

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/sec
    • normal — 4.5 chars/sec
    • fast — 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

abdelrahmanmegaly-jpg avatar May 19 '26 20:05 abdelrahmanmegaly-jpg