Download Telegram media from a chat
tg_downloadDownload media files from a Telegram chat to a local directory. Use chat ID or @username, filter by file extensions, and set a range (recent N or messages after an ID). Skips already downloaded files.
Instructions
Download media files from one chat (by id or @username) to a local directory and return the absolute paths of newly downloaded files. Use extensions (csv, e.g. 'xlsx,pdf') to fetch only certain file types; since_id for 'everything new after message X'; last_n for 'the latest N media messages' (default 100). Already-present files are skipped (--skip-same).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat | Yes | Chat id or @username/domain (as shown by tg_chats) | |
| dest | No | Destination directory (default ~/Downloads/telegram) | |
| last_n | No | How many recent media messages to consider (default 100) | |
| since_id | No | Only messages with id > since_id (overrides last_n) | |
| extensions | No | Comma-separated file extensions to include, e.g. 'xlsx,pdf' |