(buffer: Buffer)
| 169 | // Try to get document/photo info for raw download |
| 170 | let doc = media?.document ?? media?.photo; |
| 171 | if (doc && doc.id && doc.accessHash) { |
| 172 | // Small files: use raw download |
| 173 | const isLarge = doc.size && doc.size > 1024 * 1024; |
| 174 | if (!isLarge) { |
| 175 | const location = new Api.InputDocumentFileLocation({ |
| 176 | id: doc.id, |
| 177 | accessHash: doc.accessHash, |
| 178 | fileReference: doc.fileReference, |
| 179 | thumbSize: "w", |