Get file_id or file_url of a channel message of telegram API?

224 Views Asked by At

I am getting messages from a telegram channel via messages.getHistory. The result is messages.channelMessages which contains a list(Vector) of message. Each message can have a messageMedia attached to it which mainly are messageMediaDocument. The document also has a unique document id that is referring to a file such as a video or audio. I am wondering if there is any way to get the file id or file URL of that document on the telegram server. If that is not possible, how can I access that document (which can be video, audio and etc.) somehow?

1

There are 1 best solutions below

0
Fadakar On

when get channel messages you can retrive file info that can

request TL upload.GetFile and receive file bytes

you can check this documention for nodejs

another way is check telegram web z version that how download bytes from file server