BaileysEx.Media.MessageBuilder (baileys_ex v0.1.0-alpha.8)

Copy Markdown View Source

Prepare media message content for message building and relay.

This is the synchronous Elixir counterpart to Baileys' media preparation pipeline: encrypt the media, upload it, and enrich the content map with the metadata needed by BaileysEx.Message.Builder.

Summary

Functions

Encrypt and upload media for a message content map, populating the proto fields needed for relay (url, direct_path, media_key, file hashes, etc.).

Functions

prepare(content, opts \\ [])

@spec prepare(
  map(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Encrypt and upload media for a message content map, populating the proto fields needed for relay (url, direct_path, media_key, file hashes, etc.).

Returns the content map unchanged if media is already uploaded (:media_upload key present).