devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click!
https://waha.devlike.pro/
Apache License 2.0
806 stars 247 forks source link

[BUG][NOWEB] - Presence keeps on typing after sending message. #365

Closed augustovmedeiros closed 3 weeks ago

augustovmedeiros commented 3 weeks ago

After sending a message, the presence gets stuck on "typing", while if you do not send the message the status will change after stop typing to "ONLINE Version

{
  "version": "2024.6.2",
  "engine": "NOWEB",
  "tier": "PLUS",
  "browser": "/usr/bin/google-chrome-stable"
}

To Reproduce Steps to reproduce the behavior:

  1. Open a NOWEB session
  2. Send a message to the session
  3. Check the status with http://ip:3000/api/session/presence/id_number@c.us
  4. See error

Expected behavior

It should change to "online" closely after sending the message.

Engine I'm using NOWEB engine.

patron:PLUS

devlikepro commented 3 weeks ago

Hi! You need to manually set the presence each time By default it shows the "typing" status for 10 seconds or so, if you don't send online or paused status. https://waha.devlike.pro/docs/how-to/presence/#set-presence

Ideally, so the flow should be something like this. chatId here - is the recipient, not your account

  1. Subscribe for receipient presence (POST POST /api/{session}/presence/{chatId}/subscribe (it's optional tho, usually working without that too)
  2. Start typing (POST /api/{session}/presence with presence: typing and chatId)
  3. Wait few seconds
  4. Stop typing (POST /api/{session}/presence with presence: paused and chatId)
  5. Send a message - POST /api/sendText or others

Let me know if that helps or if it's not that you asked about!

patron:PRO