2017-12-14 07:39:12 +00:00
|
|
|
package telegram
|
|
|
|
|
2018-02-15 23:28:49 +00:00
|
|
|
import json "github.com/pquerna/ffjson/ffjson"
|
2017-12-14 07:39:12 +00:00
|
|
|
|
2018-04-19 13:02:15 +00:00
|
|
|
// GetUserProfilePhotosParameters represents data for GetUserProfilePhotos method.
|
2018-02-15 23:28:49 +00:00
|
|
|
type GetUserProfilePhotosParameters struct {
|
2018-10-12 11:44:27 +00:00
|
|
|
// Unique identifier of the target user
|
2018-02-15 23:28:49 +00:00
|
|
|
UserID int `json:"user_id"`
|
2018-10-12 11:44:27 +00:00
|
|
|
|
|
|
|
// Sequential number of the first photo to be returned. By default, all
|
|
|
|
// photos are returned.
|
|
|
|
Offset int `json:"offset,omitempty"`
|
|
|
|
|
|
|
|
// Limits the number of photos to be retrieved. Values between 1—100 are
|
|
|
|
// accepted. Defaults to 100.
|
|
|
|
Limit int `json:"limit,omitempty"`
|
2018-02-15 23:28:49 +00:00
|
|
|
}
|
2017-12-14 07:39:12 +00:00
|
|
|
|
|
|
|
// GetUserProfilePhotos get a list of profile pictures for a user. Returns a UserProfilePhotos object.
|
2018-08-21 11:05:04 +00:00
|
|
|
func (bot *Bot) GetUserProfilePhotos(params *GetUserProfilePhotosParameters) (photos *UserProfilePhotos, err error) {
|
2018-02-15 23:28:49 +00:00
|
|
|
dst, err := json.Marshal(params)
|
|
|
|
if err != nil {
|
2018-08-21 11:05:04 +00:00
|
|
|
return
|
2017-12-14 07:39:12 +00:00
|
|
|
}
|
|
|
|
|
2018-04-12 11:58:05 +00:00
|
|
|
resp, err := bot.request(dst, MethodGetUserProfilePhotos)
|
2017-12-14 07:39:12 +00:00
|
|
|
if err != nil {
|
2018-08-21 11:05:04 +00:00
|
|
|
return
|
2017-12-14 07:39:12 +00:00
|
|
|
}
|
|
|
|
|
2018-08-21 11:05:04 +00:00
|
|
|
photos = new(UserProfilePhotos)
|
|
|
|
err = json.Unmarshal(*resp.Result, photos)
|
|
|
|
return
|
2017-12-14 07:39:12 +00:00
|
|
|
}
|