Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/mtkruto/mod.ts>Client#download

Cross-runtime JavaScript library for building Telegram clients
Latest
method Client.prototype.download
import { Client } from "https://deno.land/x/mtkruto@0.6.3/mod.ts";

Download a file.

Examples

Example 1

for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
  await outFile.write(chunk);
}

Parameters

fileId: string

The identifier of the file to download.

optional
params: DownloadParams

Returns

AsyncGenerator<Uint8Array, void, unknown>

A generator yielding the contents of the file.