Skip to content

GramIO API Reference / @gramio/contexts/dist / File

Class: File

Defined in: contexts/index.d.ts:660

This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.

Constructors

Constructor

new File(payload): File

Defined in: contexts/index.d.ts:662

Parameters

ParameterType
payloadTelegramFile

Returns

File

Properties

PropertyTypeDefined in
payloadTelegramFilecontexts/index.d.ts:661

Accessors

[toStringTag]

Get Signature

get [toStringTag](): string

Defined in: contexts/index.d.ts:664

MDN

Returns

string


fileId

Get Signature

get fileId(): string

Defined in: contexts/index.d.ts:668

Identifier for this file, which can be used to download or reuse the file

Returns

string


filePath

Get Signature

get filePath(): string

Defined in: contexts/index.d.ts:681

File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.

Returns

string


fileSize

Get Signature

get fileSize(): number

Defined in: contexts/index.d.ts:675

File size, if known

Returns

number


fileUniqueId

Get Signature

get fileUniqueId(): string

Defined in: contexts/index.d.ts:673

Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.

Returns

string