Open Ali559 opened 1 year ago
you can't get a URL of a picture but you can download it and probably convert it to base64 to show it in your html. https://gram.js.org/beta/classes/TelegramClient.html#downloadProfilePhoto
Hey @painor thanks for the quick reply, I appreciate it.
@painor When utilizing web.telegram.org, the profile pictures are presented as HTTP images. Given that web.telegram.org can acquire a public URL, I believe that gramjs should also have the capability to do so.
Here's an example of a gramjs profile picture:
<img src="blob:https://web.telegram.org/249ccf3b-4646-4ba7-a08f-80ac85c146f2" alt="" class="" style="width: 581px;" draggable="true">
They simply host it in their server. They download it as a blob (buffer) and then they can do whatever they want with it.
Gramjs does not have a server to upload things to nor does telegram provide any.
So I've been trying to find a way to get a user's profile picture and send it to my frontend app in view it in basic html, I've noticed that the data comes as a buffer and I cannot decode it.
so what I'm asking is simple: How do I get the URL for a user's profile picture?