LemonChannels.Adapters.Telegram.Transport.RuntimeState (lemon_channels v0.1.0)

View Source

Small helper over Telegram transport runtime state.

This keeps adapter-owned runtime state explicit without turning the transport into a large struct migration in the middle of the PR5 seam refactor.

Summary

Functions

initial_offset(config_offset, stored_offset, drop_pending_updates?)

@spec initial_offset(integer() | nil, integer() | nil, boolean()) :: integer()

new(attrs)

@spec new(map()) :: map()

parse_allowed_chat_ids(list)

@spec parse_allowed_chat_ids(term()) :: [integer()] | nil

take_current_buffer(state, scope_key, debounce_ref)

@spec take_current_buffer(map(), term(), reference()) :: {map(), map() | nil}

take_current_media_group(state, group_key, debounce_ref)

@spec take_current_media_group(map(), term(), reference()) :: {map(), map() | nil}