User-facing WhatsApp message struct.
This is the high-level value applications pass to ExWapp, similar to how an email library exposes a mail struct instead of making users call MIME builders directly.
Summary
Types
High-level message categories supported by the public API.
Runtime-neutral message value passed into transport adapters.
Functions
Builds an audio message from bytes, a filesystem path, or a pre-uploaded reference.
Builds a single WhatsApp contact card message.
Builds a document message from bytes, a filesystem path, or a pre-uploaded reference.
Builds a WhatsApp calendar event message.
Builds an image message from bytes, a filesystem path, or a pre-uploaded reference.
Builds a static GPS location message.
Builds a read receipt message for one or more message IDs.
Builds a plain text message.
Builds a typing indicator message.
Types
@type message_type() :: :text | :typing | :read_receipt | :image | :audio | :document | :location | :contact | :event | atom()
High-level message categories supported by the public API.
@type t() :: %ExWapp.Message{ body: term(), id: String.t() | nil, metadata: map(), opts: keyword(), to: String.t(), type: message_type() }
Runtime-neutral message value passed into transport adapters.
Functions
@spec audio(String.t(), ExWapp.Media.source(), keyword()) :: t()
Builds an audio message from bytes, a filesystem path, or a pre-uploaded reference.
Builds a single WhatsApp contact card message.
vcard must contain the complete vCard payload (normally vCard 3.0).
@spec document(String.t(), ExWapp.Media.source(), keyword()) :: t()
Builds a document message from bytes, a filesystem path, or a pre-uploaded reference.
Builds a WhatsApp calendar event message.
This message type exists in WhatsApp Web but is less stable than text,
media, location, and contact messages. start_time may be a Unix timestamp
in seconds or a DateTime.
@spec image(String.t(), ExWapp.Media.source(), keyword()) :: t()
Builds an image message from bytes, a filesystem path, or a pre-uploaded reference.
Builds a static GPS location message.
Latitude and longitude are encoded as protobuf doubles. Optional fields such
as :name, :address, :url, :comment, and :accuracy are kept in
opts until the session transport builds the wire payload.
Builds a read receipt message for one or more message IDs.
Builds a plain text message.
This is the simplest outbound message form and maps to WhatsApp's
conversation or extendedTextMessage protobuf fields depending on options.
Builds a typing indicator message.
The boolean body is interpreted as true => composing and false => paused.