tg_media
List media attachments in a chat by kind, returning message IDs, file names, sizes, and durations. Paginate older items using before_id.
Instructions
Attachments in a chat, the way Telegram's own media tabs work.
Returns message ids, file names, sizes, mime types and durations — feed those ids to tg_download_many to actually fetch the files.
Args: chat: chat id, @username, exact title, or "me". kind: media (photos+videos), photo, video, file, music, voice, round, gif, link, pinned, geo, contact. limit: how many items. before_id: paginate to items older than this message id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat | Yes | ||
| kind | No | media | |
| limit | No | ||
| before_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |