Skip to content
This repository has been 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

Open
uliton opened this issue Jul 30, 2024 · 0 comments
Open

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

uliton opened this issue Jul 30, 2024 · 0 comments

Comments

@uliton
Copy link

uliton commented Jul 30, 2024

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'
}
]
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant