Skip to content

Events

The Node bridge normalizes messy raw Baileys events into a clean, consistent shape before handing them to Python. Each event has an event name and a data payload.

Event types

Event Description
message.new A new text message
message.update A message was edited
message.reaction An emoji reaction
status.new A status / story update
conversation.new A unified conversation event
media.new An image, video, or document was received

Connection lifecycle events

These control the session rather than carrying chat content:

Event Description
auth.qr A login QR code is available to scan
connection.open The WhatsApp session is live (includes the connected user id)
connection.close The session dropped (loggedOut flag distinguishes logout from a reconnectable drop)
error An error occurred on the bridge

Normalized shape

A raw Baileys message looks like:

{
  "key": { "remoteJid": "919800000000@s.whatsapp.net" },
  "message": { "conversation": "hello" }
}

PyWacli normalizes it to:

{
  "event": "message",
  "chat": "919800000000",
  "text": "hello",
  "fromMe": false,
  "timestamp": 1715955500
}

This normalization is the key bridge between the JavaScript and Python halves of PyWacli — the Python event_processor consumes these clean events and routes each to the right database table and, for media, to your configured storage.