Read a Telegram attachment
telegram_get_fileUse this to read a document shared in Telegram and answer questions about its contents, such as a contract, invoice or spreadsheet. First locate the message with telegram_get_messages or telegram_search_messages to obtain chat_id and message_id. This does not search for files by name. For a spreadsheet (.xlsx), Word document (.docx), PDF or any text format this returns the actual contents — cells, paragraphs, rows — so you can answer questions about what is inside it. Spreadsheet rows come back tab-separated, one sheet per '## name' heading. For a video, audio or image there is a link and metadata; Session audio/video also returns a ready transcript when available. Reusing a ready bot or Session transcript is free. For Session audio/video, transcribe=true explicitly requests a new transcript using ordinary minutes only if none exists. Pending work persists; check again later, without repeated polling. Use the chat_id and message_id of a message whose message_type is not 'text'. Telegram refuses to serve files over 20 MB to a bot, so those cannot be fetched.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | Yes | Chat the file is in. | |
| max_chars | No | How much text to return at once. Defaults to a readable slice. | |
| message_id | Yes | message_id of the message carrying the file. | |
| transcribe | No | Default false. Only on an explicit user request, transcribe Session audio/video if no ready transcript exists; consumes normal minutes on success. | |
| include_text | No | Default true. Set false to get only metadata and skip reading contents. | |
| offset_lines | No | Skip this many lines before reading. A big spreadsheet does not fit in one response, so page through it: the result says which lines you got and how many there are in total. |