Layer 227
PhotosUploadContactProfilePhoto
Upload a custom profile picture for a contact, or suggest a new profile picture to a contact.
method
Users
photos.uploadContactProfilePhoto#e14c4a71 flags:# suggest:flags.3?true save:flags.4?true user_id:InputUser file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.5?VideoSize = photos.Photo;
Parameters
| Name | Type | Description |
|---|---|---|
| Suggest | flags .3? true | If set, will send a message Action Suggest Profile Photo service message to user_id, suggesting them to use the specified profile picture; otherwise, will set a personal profile picture for the user (only visible to the current user). |
| Save | flags .4? true | If set, removes a previously set personal profile picture (does not affect suggested profile pictures, to remove them simply delete the message Action Suggest Profile Photo service message with messages. delete Messages ). |
| UserId | InputUser | The contact |
| File | flags .0? InputFile | Profile photo |
| Video | flags .1? InputFile | Animated profile picture video |
| VideoStartTs | flags .2? double | Floating point UNIX timestamp in seconds, indicating the frame of the video/sticker that should be used as static preview; can only be used if video or video_emoji_markup is set. |
| VideoEmojiMarkup | flags .5? VideoSize | Animated sticker profile picture, must contain either a video Size Emoji Markup or a video Size Sticker Markup constructor. |
Returns
photos.PhotoGogram Example
// PhotosUploadContactProfilePhoto - using Params struct result, err := client.PhotosUploadContactProfilePhoto(&tg.PhotosUploadContactProfilePhotoParams{ Suggest: nil, Save: nil, UserId: &tg.InputUserSelf{}, File: nil, Video: nil, VideoStartTs: nil, VideoEmojiMarkup: nil, }) if err != nil { // handle error } // result is *tg.PhotosPhoto
Possible Errors
| Code | Type | Description |
|---|---|---|
| 400 | CONTACT_MISSING | The specified user is not a contact. |
| 400 | NEED_ACTION_MISSING | |
| 400 | USER_ID_INVALID | The provided user ID is invalid. |