tg_export
Export entire Telegram chats to local files, including attachments and links, for analysis or archival.
Instructions
Dump whole conversations to files (max 5000 messages per chat).
With media=true every attachment is downloaded next to the transcript and
each message carries the local file path, its links, and a t.me link to the
message itself where one exists. That is the tool for "give me the full
conversation with everything in it", and it pairs with tg_activity: take
the chat ids from there, feed them in as chats.
Args: chat: one chat to export. chats: several chats at once, up to 25. One failure does not stop the rest. limit: how many recent messages per chat, written oldest first. format: json for analysis, markdown or text for reading. dest: target directory. Defaults to tg-agent/data/downloads. since: only messages from this point — "today" or an ISO datetime. until: upper bound, ISO datetime. media: also download every attachment. media_max_mb: skip attachments larger than this (they are listed as skipped).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat | No | ||
| dest | No | ||
| chats | No | ||
| limit | No | ||
| media | No | ||
| since | No | ||
| until | No | ||
| format | No | json | |
| media_max_mb | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |