8

I'm making a basic Control Panel for managing my Bot with PHP.

Basically I want to display the Profile picture / avatar of the user who is sending message to the bot.

However the user object has no photo_id, so is there way to get the user's avatar?

1 Answers1

12

You need to use getUserProfilePhotos method, and then getFile.

For example: Awesome Telegram Bot

Sean Wei
  • 7,433
  • 1
  • 19
  • 39
  • getFile requires a file_path argument that is not returned from getUserProfilePhotos. If I try to use the file_id as file_path ther I get a "NOT FOUND" error. – Power Engineering Mar 18 '22 at 17:43
  • ok I fixed it!. You need to call getFile using file_id as argument , you will receive the file_path and then you can download the file using https://api.telegram.org/file/bot/ – Power Engineering Mar 18 '22 at 17:46