tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

File (all media) handling #2938

Closed lexermekongnet closed 1 week ago

lexermekongnet commented 4 months ago

How does tdlib handle files?

I'm creating a chat system which utilizes tdlib, when I receive updateNewMessage, I also get which kind of message it is such as messageText or messagePhoto

When I declutter the messagePhoto fields I can't seem to find the url of the photo, see I'm a newbie in the backend so I assume messageText would contain the text and messagePhoto (or any message Media) would contain a url.

This leads me to my question how can I get the file(s) being emit by updateNewMessage's messagePhoto.

What's in my mind is I would use downloadFile and save it to my own server so I could "view" it on my own web UI.

levlam commented 4 months ago

You can download the file by passing its identifier to downloadFile.