Skip to main content

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

NameTypeRequiredDescription
FallbackboolIf set, the chosen profile photo will be shown to users that can't display your main profile photo due to your privacy settings.
BotInputUserClassCan contain info of a bot we own, to change the profile photo of that bot, instead of the current user.
IDInputPhotoClassyesInput photo

Returns

*PhotosPhoto

Possible errors

CodeTypeDescription
400ALBUM_PHOTOS_TOO_MANYYou have uploaded too many profile photos, delete some before retrying.
400BOT_FALLBACK_UNSUPPORTEDThe fallback flag can't be set for bots.
400FILE_PARTS_INVALIDThe number of file parts is invalid.
400IMAGE_PROCESS_FAILEDFailure while processing image.
400LOCATION_INVALIDThe provided location is invalid.
400PHOTO_CROP_SIZE_SMALLPhoto is too small.
400PHOTO_EXT_INVALIDThe extension of the photo is invalid.
400PHOTO_ID_INVALIDPhoto ID invalid.

References