class

Autobot::Channels::WhatsAppChannel

Inherits Autobot::Channels::Channel < Reference < Object

WhatsApp channel that connects to a Node.js bridge.

The bridge uses @whiskeysockets/baileys to handle the WhatsApp Web protocol. Communication is via JSON messages over WebSocket.

Features:

  • QR code authentication (displayed in bridge terminal)
  • Message handling (text, voice notes as attachments)
  • Connection state management
  • Auto-reconnection with backoff
  • Allow list for access control

Constants

Log = ::Log.for("channels.whatsapp")
RECONNECT_DELAY = 5
VOICE_MESSAGE = "[Voice Message]"

Constructors

new(bus : Bus::MessageBus, bridge_url : String = "ws://localhost:3001", allow_from : Array(String) = [] of String)
Source

Instance methods

send_message(message : Bus::OutboundMessage) : Nil

Send an outbound message through this channel.

Source
start

Start the channel and begin listening for messages.

Source
stop

Stop the channel and clean up resources.

Source