download_attachment
Downloads one selected Telegram attachment (ID from get_messages or get_album) up to 20 MiB, returning a local file path and ResourceLink instead of inline bytes.
Instructions
Download one explicitly selected attachments[].id, up to 20 MiB.
Requires allow_attachment_downloads and ordinary source-read permission. Use
get_messages or get_album to select an attachment first. The ID selects the current
attachment at that message, not an archived version. Protected and expiring media
cannot be downloaded. Returns a local path and a ResourceLink, without inline bytes;
use resources/read before expires_at to retrieve binary content. Files expire after
15 minutes or server shutdown. The local path is on the server computer. Temporary
failures require retrying this call; respect retry_after_seconds. No partial resume.
save=true retains a permanent copy when archive_directory is configured.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| save | No | ||
| attachment_id | Yes |