Anu.Event.Message (Anu v0.2.0)

Copy Markdown View Source

Represents an inbound WhatsApp message received via webhook.

Fields

  • :id - the message ID (wamid)
  • :from - sender's phone number
  • :timestamp - Unix timestamp as a string
  • :type - message type (e.g. "text", "image", "button")
  • :text - text body (for text messages)
  • :image - image metadata map
  • :video - video metadata map
  • :document - document metadata map
  • :audio - audio metadata map
  • :sticker - sticker metadata map
  • :location - location data map
  • :contacts - contacts list
  • :button_reply - button reply payload (for interactive button responses)
  • :list_reply - list reply payload (for interactive list responses)
  • :phone_number_id - the receiving phone number ID (from payload metadata)
  • :display_phone_number - the receiving display phone number (from payload metadata)
  • :raw - the raw message map from Meta's webhook payload

Summary

Types

t()

@type t() :: %Anu.Event.Message{
  audio: map() | nil,
  button_reply: map() | nil,
  contacts: [map()] | nil,
  display_phone_number: String.t() | nil,
  document: map() | nil,
  from: String.t(),
  id: String.t(),
  image: map() | nil,
  list_reply: map() | nil,
  location: map() | nil,
  phone_number_id: String.t() | nil,
  raw: map(),
  sticker: map() | nil,
  text: String.t() | nil,
  timestamp: String.t(),
  type: String.t(),
  video: map() | nil
}