LemonChannels. Adapters. Telegram. Transport. FileOperations
(lemon_channels v0.1.0)
View Source
File upload/download operations for the Telegram transport.
Handles /file put, /file get, auto-put for bare document uploads,
and media-group file batching. Functions here perform I/O (Telegram API
calls, filesystem writes) but do not directly mutate GenServer state.
Summary
Functions
Extract the file_id from whichever media type is present.
Extract the first present media attachment from the inbound message.
Returns {media_type, media_map} or nil.
Process a media group of document uploads via auto-put behavior.
Handle the /file command dispatch (put / get / usage).
Process a media group where one item carries a /file put caption.
Handle a single bare media upload via auto-put.
Returns true when the inbound message has any downloadable media attachment.
Generate a filename for the media. Uses the Telegram-provided filename when
available, otherwise generates {type}_{YYYYMMDD_HHMMSS}{ext}.
Returns true when the inbound has any media attachment that should be auto-saved according to the files configuration.
Functions
Extract the file_id from whichever media type is present.
Extract the first present media attachment from the inbound message.
Returns {media_type, media_map} or nil.
Process a media group of document uploads via auto-put behavior.
Downloads each document and writes it to the configured uploads directory. Sends a summary system message.
Handle the /file command dispatch (put / get / usage).
Returns the updated state.
Process a media group where one item carries a /file put caption.
Handle a single bare media upload via auto-put.
Returns {:ok, final_rel} or {:error, reason}.
Returns true when the inbound message has any downloadable media attachment.
Generate a filename for the media. Uses the Telegram-provided filename when
available, otherwise generates {type}_{YYYYMMDD_HHMMSS}{ext}.
Returns true when the inbound has any media attachment that should be auto-saved according to the files configuration.