Functional Sub-Spec: File Upload & Attachment Download Engine
Requirements Traceability
[FUNC-007]: File & Media Upload Dispatch
[FUNC-008]: File & Media Attachment Download Engine
Detailed Functional Descriptions
[FUNC-007] File & Media Upload Dispatch
The system must support uploading local files and media attachments directly to Telegram chats, supergroups, channels, and forum topics:
Accept target
chat_id, optional message text / caption, repeatable-a, --attach <file>flags, optional-m, --mediamode flag, and optional-t, --topic <id>thread ID.Verify local file existence and readability before initiating TDLib upload.
Support documents, photos, audio, and generic binary attachments using TDLib’s
inputFileLocalwrapper withinputMessageDocumentorinputMessagePhotopayloads.Display upload progress or completion confirmation upon successful dispatch.
[FUNC-008] File & Media Attachment Download Engine
The system must support downloading attachments (documents, photos, videos, audio) from chats and forum topics:
Single / Selective File Download:
grm file get [-o|–output <dir|file>] [-t|–topic <id>] <chat_id> <message_ids…>: Download file attachment(s) from specified message ID(s) to a target local path or directory (defaults to current directory).
Bulk / Directory File Download:
grm file download-all [-o|–output <dir>] [-t|–topic <id>] [-n|–limit <N>] [–type photo|video|doc|audio|all] <chat_id>: Batch download all attachments from a chat or specific forum topic matching file type filters.