Closed Maestrodesu closed 1 year ago
if you want to get user photos use bot.GetUserProfilePhotos(), pass tg.UserProfilePhotosConfig as parameter, respone will return as update.Message.Photo and TotalCount.
This type has a Photos [][]PhotoSize json:"photos"
field, of which [1][2]
1) number of pictures by index
2) size of pictures (the size you want)
recommended =>
p := Photos
fileID := p[0][len(p) - 1].FileID
fileID := update.Message.Photo[0].FileID
The highest size is taken
It's working, thanks!
Example below will download the highest size of picture, which user sent to you
if update.Message.Photo != nil {
p := update.Message.Photo
fileID := p[len(p)-1].FileID
bot.GetFileDirectURL(fileID)
}
Why is there update.Message.Video.FileID and update.Message.Document.FileID but no update.Message.Photo.FileID? How can i get photo file id?