(messages: any[], id: string, frame: Buffer)
| 854 | }), |
| 855 | dcId, |
| 856 | ), |
| 857 | QUOTE_RPC_TIMEOUT_MS, |
| 858 | "rawDownloadFile", |
| 859 | ) as { bytes?: unknown }; |
| 860 | const buffer = result?.bytes; |
| 861 | return Buffer.isBuffer(buffer) && buffer.length > 0 ? buffer : undefined; |
| 862 | } catch (err: any) { |
| 863 | console.warn("quote rawDownloadFile failed", err?.message || err); |
| 864 | return undefined; |
| 865 | } |
| 866 | } |
| 867 | |
| 868 | /** |
| 869 | * Download a Document (e.g. custom emoji) via raw upload.GetFile, |
| 870 | * bypassing the MediaScheduler's 75s retry loop. |
| 871 | */ |
| 872 | async function rawDownloadDocument(client: any, doc: any): Promise<Buffer | undefined> { |
| 873 | if (!client || !doc) return undefined; |
| 874 | const location = new Api.InputDocumentFileLocation({ |
| 875 | id: doc.id, |
| 876 | accessHash: doc.accessHash, |
no outgoing calls
no test coverage detected