Nadia.InputProfilePhoto (nadia v1.6.1)

View Source

Typed builders for Telegram InputProfilePhoto objects.

Profile photos can't be reused: photo and animation accept only new multipart uploads created with Nadia.InputFile.path/2, bytes/3, or a known-size stream/3. File IDs, URLs, bare binaries, and manual attach:// references are rejected.

Nadia fixes the Telegram type discriminator, omits nil options, and validates metadata it can inspect. Telegram still enforces the actual file format: static profile photos must be JPG images and animated profile photos must be MPEG4 videos. Nadia does not decode uploads to inspect their format or other media properties.

Summary

Types

t()

A typed Telegram InputProfilePhoto value. Its representation is opaque.

Functions

Builds an animated MPEG4 profile-photo upload.

Builds a static JPG profile-photo upload.

Types

options()

@type options() :: keyword() | map()

t()

@opaque t()

A typed Telegram InputProfilePhoto value. Its representation is opaque.

upload()

@type upload() :: Nadia.InputFile.t()

Functions

animated(animation, options \\ [])

@spec animated(upload(), options()) :: t()

Builds an animated MPEG4 profile-photo upload.

:main_frame_timestamp is the nonnegative timestamp, in seconds, of the frame Telegram should use as the static profile photo.

static(photo)

@spec static(upload()) :: t()

Builds a static JPG profile-photo upload.