whatsapp_baileys
whatsapp_baileys
¶
WhatsAppBaileysChannel -- bidirectional WhatsApp messaging via Baileys protocol.
Spawns a Node.js subprocess that runs the Baileys bridge (JSON-line protocol on stdio). The bridge handles QR-code authentication, message sending, and incoming-message forwarding.
Classes¶
WhatsAppBaileysChannel
¶
WhatsAppBaileysChannel(
*,
auth_dir: str = "",
assistant_name: str = "Diapason",
assistant_has_own_number: bool = False,
bus: Optional[EventBus] = None,
)
Bases: BaseChannel
Bidirectional WhatsApp channel using the Baileys protocol.
Communicates with a Node.js bridge subprocess over JSON-line stdio.
| PARAMETER | DESCRIPTION |
|---|---|
auth_dir
|
Directory for Baileys auth state persistence. Defaults to
TYPE:
|
assistant_name
|
Display name used by the assistant in conversations.
TYPE:
|
assistant_has_own_number
|
If
TYPE:
|
bus
|
Optional event bus for publishing channel events.
TYPE:
|
Source code in src/diapason/channels/whatsapp_baileys.py
Methods:¶
connect
¶
Spawn the Node.js bridge subprocess and start the reader thread.
Source code in src/diapason/channels/whatsapp_baileys.py
disconnect
¶
Send disconnect command to the bridge and terminate the subprocess.
Source code in src/diapason/channels/whatsapp_baileys.py
send
¶
send(
channel: str,
content: str,
*,
conversation_id: str = "",
metadata: Dict[str, Any] | None = None,
) -> bool
Send a message to a WhatsApp JID via the bridge subprocess.
Source code in src/diapason/channels/whatsapp_baileys.py
status
¶
status() -> ChannelStatus