This example shows the smallest runnable bot in the repository. It opens a real WhatsApp connection with BaileysEx.Connection.Transport.MintWebSocket, persists credentials and Signal keys, and echoes inbound text messages back to the sender.
Run the example
mix run examples/echo_bot.exs -- --auth-path tmp/echo_bot_auth
On the first run, scan the QR code or use phone pairing. On later runs, the saved credentials in tmp/echo_bot_auth are reused.
What it demonstrates
- loading and saving auth state with
BaileysEx.Auth.NativeFilePersistence - starting a real connection under a host-owned supervisor
- subscribing to
:creds_updateand incoming messages - replying with
BaileysEx.send_message/4
Source
The runnable script lives at examples/echo_bot.exs.
See also: