Skip to main content
Module

x/grammy_hydrate/deps.deno.ts>InputFile

Hydration plugin for API calls and context objects.
Latest
class InputFile
Re-export
import { InputFile } from "https://deno.land/x/grammy_hydrate@v1.4.1/deps.deno.ts";

An InputFile wraps a number of different sources for sending files.

It corresponds to the InputFile type in the Telegram Bot API Reference.

Constructors

new
InputFile(file: MaybeSupplier<
| string
| Blob
| URL
| URLLike
| Uint8Array
| ReadableStream<Uint8Array>
| Iterable<Uint8Array>
| AsyncIterable<Uint8Array>
>
, filename?: string
)

Constructs an InputFile that can be used in the API to send files.

Properties

private
consumed: boolean
private
readonly
fileData: ConstructorParameters<InputFile>[0]
readonly
optional
filename: string

Optional name of the constructed InputFile instance.

Check out the documentation on sending files with InputFile.

Methods

private
guessFilename(file: ConstructorParameters<InputFile>[0]): string | undefined
toRaw(): Promise<Uint8Array | Iterable<Uint8Array> | AsyncIterable<Uint8Array>>

Internal method. Do not use.

Converts this instance into a binary representation that can be sent to the Bot API server in the request body.

Constructors

new
InputFile(file: MaybeSupplier<
| string
| Blob
| URL
| URLLike
| Uint8Array
| ReadableStream<Uint8Array>
| Iterable<Uint8Array>
| AsyncIterable<Uint8Array>
>
, filename?: string
)

Constructs an InputFile that can be used in the API to send files.

Properties

private
consumed: boolean
private
readonly
fileData: ConstructorParameters<InputFile>[0]
readonly
optional
filename: string

Optional name of the constructed InputFile instance.

Check out the documentation on sending files with InputFile.

Methods

private
guessFilename(file: ConstructorParameters<InputFile>[0]): string | undefined
toRaw(): Promise<Uint8Array | Iterable<Uint8Array> | AsyncIterable<Uint8Array>>

Internal method. Do not use.

Converts this instance into a binary representation that can be sent to the Bot API server in the request body.