photos.updateProfilePhoto
Installs a previously uploaded photo as a profile photo.
func (c *Client) PhotosUpdateProfilePhoto(ctx context.Context, request *PhotosUpdateProfilePhotoRequest) (*PhotosPhoto, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.PhotosUpdateProfilePhoto(ctx, &tg.PhotosUpdateProfilePhotoRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *PhotosPhoto
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Fallback | bool | — | If set, the chosen profile photo will be shown to users that can't display your main profile photo due to your privacy settings. |
Bot | InputUserClass | — | Can contain info of a bot we own, to change the profile photo of that bot, instead of the current user. |
ID | InputPhotoClass | yes | Input photo |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | ALBUM_PHOTOS_TOO_MANY | You have uploaded too many profile photos, delete some before retrying. |
| 400 | BOT_FALLBACK_UNSUPPORTED | The fallback flag can't be set for bots. |
| 400 | FILE_PARTS_INVALID | The number of file parts is invalid. |
| 400 | IMAGE_PROCESS_FAILED | Failure while processing image. |
| 400 | LOCATION_INVALID | The provided location is invalid. |
| 400 | PHOTO_CROP_SIZE_SMALL | Photo is too small. |
| 400 | PHOTO_EXT_INVALID | The extension of the photo is invalid. |
| 400 | PHOTO_ID_INVALID | Photo ID invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
photos.updateProfilePhoto#9e82039