Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/mtkruto/mod.ts>Client#download

[WIP] Cross-runtime JavaScript library for building Telegram clients
Go to Latest
method Client.prototype.download
import { Client } from "https://deno.land/x/mtkruto@0.1.139/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.