Nadia.InputStoryContent (nadia v1.6.0)

View Source

Typed builders for Telegram InputStoryContent objects.

Story media can't be reused: photo and video 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, preserves explicit false, and validates metadata it can inspect. Telegram still enforces the media itself: story photos must be 1080x1920 and at most 10 MB; story videos must be 720x1280, streamable MPEG4 encoded with H.265, include a key frame each second, and be at most 30 MB. Nadia does not decode uploads to verify dimensions, format, codec, streamability, keyframes, sound, or size.

Summary

Types

t()

A typed Telegram InputStoryContent value. Its representation is opaque.

Functions

Builds a story-photo upload.

Builds a story-video upload.

Types

options()

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

t()

@opaque t()

A typed Telegram InputStoryContent value. Its representation is opaque.

upload()

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

Functions

photo(photo)

@spec photo(upload()) :: t()

Builds a story-photo upload.

video(video, options \\ [])

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

Builds a story-video upload.

:duration accepts a number from 0 through 60 seconds. :cover_frame_timestamp must be nonnegative and, when duration is supplied, no greater than the duration. :is_animation must be a boolean and tells Telegram that the video has no sound.