Presence in WhatsApp describes what another user is currently doing: whether they are online, typing a message, recording an audio clip, or have gone inactive. Baileys lets you both subscribe to presence updates from other contacts and broadcast your own presence to them.Documentation Index
Fetch the complete documentation index at: https://whiskeysockets-docs-jids-socket-config-ptbr.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Presence states
| State | Meaning |
|---|---|
available | The user is online and active |
unavailable | The user is offline or the app is in background |
composing | The user is typing a message |
recording | The user is recording a voice message |
paused | The user started typing but stopped |
Subscribe to presence updates
CallpresenceSubscribe with a chat JID to request that WhatsApp start sending you presence notifications for that chat. You then listen for the presence.update event to receive the data.
Full subscribe and listen pattern
For group chats,
presences is a map of individual participant JIDs to their presence data. For one-on-one chats, it will contain a single entry for the contact.Broadcast your own presence
UsesendPresenceUpdate to tell WhatsApp what you are currently doing. You can optionally scope it to a specific chat JID; omitting jid broadcasts to all open subscriptions.
WAPresence values are:
| Value | When to use |
|---|---|
available | Your client is active and the user is present |
unavailable | Your client is idle or the user has left the app |
composing | The user is typing in the given chat |
recording | The user is recording a voice message in the chat |
paused | The user stopped typing without sending |
Receiving push notifications on the phone
When your Baileys client is marked asavailable, WhatsApp treats it as an active desktop session and suppresses push notifications to the paired phone. If you want the phone to keep receiving push notifications, mark your client as offline on connect:
unavailable presence after connecting: