Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

How to download files uploaded to channels, groups or simple chats? #303

@uliton

Description

@uliton

I am using the .call('messages.getHistory') method.
In response, I have an object with the key .messages, which contains an array of objects.
In these objects, the .media.document.file_reference key contains an object of type Uint8Array.
But what to do with it to download the file is not clear.
Help figure it out.

Example of object .messages[0].media.document
{
_: 'document',
flags: 0,
id: '5057097618496608694',
access_hash: '8969828831849769916',
file_reference: Uint8Array(29) [
2, 98, 54, 110, 138, 0, 0, 15,
54, 102, 169, 26, 61, 81, 84, 67,
199, 47, 40, 227, 67, 242, 44, 113,
117, 75, 252, 223, 1
],
date: 1722352521,
mime_type: 'text/plain',
size: '788730',
dc_id: 4,
attributes: [
{
_: 'documentAttributeFilename',
file_name: 'Update.txt'
}
]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions