Nadia.InputPollMedia (nadia v1.6.0)

View Source

Typed builders for media that is specific to Telegram polls.

Poll descriptions and quiz explanations support locations and venues in addition to selected Nadia.InputMedia variants. Poll options additionally support links and stickers.

Builders fix the Telegram type discriminator and omit options whose value is nil. Sticker uploads must use .webp, .tgs, or .webm filenames; HTTP sticker URLs must use a .webp URL path.

Summary

Types

t()

A typed poll-media value. Its representation is opaque.

Functions

Builds an HTTP or HTTPS link for a poll option.

Builds a location for a poll description, explanation, or option.

Builds a sticker for a poll option.

Builds a venue for a poll description, explanation, or option.

Types

context()

@type context() :: :description | :explanation | :option

options()

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

source()

@type source() :: binary() | Nadia.InputFile.t()

t()

@opaque t()

A typed poll-media value. Its representation is opaque.

variant()

@type variant() :: :link | :location | :sticker | :venue

Functions

link(url)

@spec link(binary()) :: t()

Builds an HTTP or HTTPS link for a poll option.

location(latitude, longitude, options \\ [])

@spec location(number(), number(), options()) :: t()

Builds a location for a poll description, explanation, or option.

sticker(media, options \\ [])

@spec sticker(source(), options()) :: t()

Builds a sticker for a poll option.

venue(latitude, longitude, title, address, options \\ [])

@spec venue(number(), number(), binary(), binary(), options()) :: t()

Builds a venue for a poll description, explanation, or option.