Skip to content

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

Class: File ​

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

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:714

Parameters ​

ParameterType
payloadTelegramFile

Returns ​

File

Properties ​

PropertyTypeDefined in
payloadTelegramFilecontexts/index.d.ts:713

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

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

MDN

Returns ​

string


fileId ​

Get Signature ​

get fileId(): string

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

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:733

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:727

File size, if known

Returns ​

number


fileUniqueId ​

Get Signature ​

get fileUniqueId(): string

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

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