Wax.Messages.Media (wax v1.1.4)

The Whatsapp Message Media Object

Fields

  • id: The media object ID
  • caption: Media asset caption. Doesn't apply for audio or stickers
  • filename: Describes the filename for the specific document

Summary

Functions

Creates a new Media object of Audio type

Creates a new Media object of Document type

Creates a new Media object of Image type

Creates a new Media object of Video type

Types

media_id()

@type media_id() :: String.t()

media_type()

@type media_type() :: :audio | :document | :image | :video

t()

@type t() :: %Wax.Messages.Media{
  caption: String.t(),
  filename: String.t(),
  id: media_id(),
  type: media_type()
}

Functions

new_audio(media_id)

@spec new_audio(String.t()) :: t()

Creates a new Media object of Audio type

new_document(media_id, filename, caption \\ nil)

@spec new_document(String.t(), String.t(), String.t()) :: t()

Creates a new Media object of Document type

new_image(media_id, caption \\ nil)

@spec new_image(String.t(), String.t()) :: t()

Creates a new Media object of Image type

new_video(media_id, caption \\ nil)

@spec new_video(String.t(), String.t()) :: t()

Creates a new Media object of Video type