how do i download profile picture based on account id or group id
type ThumbUrl struct {
EURL string 'json:"eurl"'
Tag string 'json:"tag"'
Status int64 'json:"status"'
}
// RemoteJID is the sender ID the one who send the text or the media message or basically the WhatsappID just pass it here
profilePicThumb, _ := wac.GetProfilePicThumb(RemoteJID)
profilePic := <- profilePicThumb
thumbnail := ThumbUrl{}
err := json.Unmarshal([]byte(profilePic), &thumbnail)
if err != nil {
// print error
}
if thumbnail.Status = 404 {
// meaning thumbnail is not available because the person has no profile pic so what i did is return empty string
}
// Basically the EURL is what holds the profile picture of the person
return thumbnail.EURL
Most helpful comment