pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.03k stars 3.57k forks source link

Chat status method (online, typing, offline) #2636

Closed aronilie closed 3 weeks ago

aronilie commented 9 months ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like.

I would like to have the possibility to know a chat status. If it is online, typing or disconnected.

Describe an alternate solution.

No response

Additional context

No response

RC047 commented 9 months ago

If you want to change status such as online, offline, and typing, you can use a function method like this:

client.sendPresenceAvailable() // online
client.sendPresenceUnvailable() // offline
chat.sendStateTyping() // typing
chat.sendStateRecording() // recording
yaneony commented 4 months ago

I think he mean to get presence status, not to set one.

aronilie commented 4 months ago

I think he mean to get presence status, not to set one.

Exactly

nachobascar commented 4 months ago

I have the same doubt, knowing if the person is typing would help my bot to wait until he stops typing before sending a message

Solo-it commented 3 months ago

If you want to change status such as online, offline, and typing, you can use a function method like this:

client.sendPresenceAvailable() // online
client.sendPresenceUnvailable() // offline
chat.sendStateTyping() // typing
chat.sendStateRecording() // recording

Not work (