Repository navigation
Closed
Labels
enhancementNew feature or request
Description
tg send sends text only. tg api can't take file bytes, so it can't practically send or fetch a photo, a document or a voice note. The cache keeps only has_media and message_type. File names, sizes and types are only inside raw_json, and history sync writes voice messages, videos and stickers as document. telegram-mcp sends files, albums, voice and stickers, and downloads media.
Scope
- Attachment metadata (kind, file name, MIME type, size, duration, dimensions, album ID,
uniqueFileId):tg messages list/get/searchshow it for every cached message.- A per-account table filled when a message is written. Older rows are filled by Background, resumable migrations for big caches #89.
- Live updates and history pages write the same
message_type.
tg media download --chat <peer> --id <message> [--out <path|dir|->] [--thumb]:- Saves the file into the account's media cache (
accounts/<id>/media, one copy per file) and prints its path as JSON. --outcopies the file out;-writes it to stdout.--thumbfetches a small preview.- Fetches the message again for a fresh file reference and resumes a partial download.
- A file already in the cache needs no network and no credentials.
- Saves the file into the account's media cache (
- Media from chats and messages with content protection is not downloaded (
CONTENT_PROTECTED), as Telegram's content protection rules require. tg send --file <path> [--caption <text>]sends one file.tg status --sizesshows the media cache;tg media cleanremoves cached files.- The daemon stays read-only and downloads nothing.
Done when the live smoke suite sends a file to Saved Messages and downloads it back.
Follow-ups
- Search attachment names, kinds and text derived from attachments #94: attachment names, kinds and derived text in full-text search.
- raw_json: stop storing fileReference #95: stop storing
fileReferenceinraw_json. - Background media download in the daemon, with a disk quota #99: background downloads in the daemon, with a disk quota.
- Transcribe voice messages and video notes #102: voice transcription.
- Extract text from documents and images (PDF, office files, OCR) #103: text from documents and images.
- Download many attachments at once, with name templates #104: batch download with name templates.
- Search media on the server, beyond the cached history #105: server-side media search.
- As needed, without an issue: albums, voice messages and video notes for
tg send, and files served from Telegram's CDN (an error says they aren't supported).
Out of scope
- One media cache shared by several accounts.
- The daemon sending or uploading anything.
- An HTML export like Telegram Desktop's.
- A media server or gallery.
- Sending stickers and GIFs.
- Editing media.
- Secret chats.
- Stories.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity