Noizu.Telegram.Updates (Noizu Telegram v0.1.0)

Copy Markdown View Source

Incoming update polling (getUpdates).

get_updates/1 is one shot; stream/1 walks updates continuously using the offset protocol (max update_id + 1).

Summary

Functions

Bot API getUpdates.

Stream updates indefinitely: fetches with the next offset, yields each update, and advances the offset to update_id + 1. Errors raise (stopping the stream). :limit caps the fetch batch size.

Functions

get_updates(opts \\ [])

@spec get_updates(keyword()) :: {:ok, [map()]} | {:error, Noizu.Telegram.Error.t()}

Bot API getUpdates.

Opts: :offset (first update id to return), :limit (1-100), :timeout (long-poll seconds, 0 = immediate), :allowed_updates (list).

stream(opts \\ [])

@spec stream(keyword()) :: Enumerable.t()

Stream updates indefinitely: fetches with the next offset, yields each update, and advances the offset to update_id + 1. Errors raise (stopping the stream). :limit caps the fetch batch size.