photos.UploadContactProfilePhoto

class pyrogram.raw.functions.photos.UploadContactProfilePhoto

Upload a custom profile picture for a contact, or suggest a new profile picture to a contact.

Details:
  • Layer: 223

  • ID: E14C4A71

Parameters:
  • user_id (InputUser) – The contact

  • suggest (bool, optional) – If set, will send a messageActionSuggestProfilePhoto 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 (bool, optional) – If set, removes a previously set personal profile picture (does not affect suggested profile pictures, to remove them simply delete the messageActionSuggestProfilePhoto service message with messages.deleteMessages).

  • file (InputFile, optional) – Profile photo

  • video (InputFile, optional) – Animated profile picture video

  • video_start_ts (float 64-bit, optional) – 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.

  • video_emoji_markup (VideoSize, optional) – Animated sticker profile picture, must contain either a videoSizeEmojiMarkup or a videoSizeStickerMarkup constructor.

Returns:

photos.Photo

TL Schema

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

Parameter Tree

UploadContactProfilePhoto
├── suggesttrue (optional)
├── savetrue (optional)
├── user_idInputUser
│ ├── InputUserEmpty
│ ├── InputUserSelf
│ ├── InputUser
│ │ ├── user_idlong
│ │ └── access_hashlong
│ └── InputUserFromMessage
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── user_idlong
├── fileInputFile (optional)
│ ├── InputFile
│ │ ├── idlong
│ │ ├── partsint
│ │ ├── namestring
│ │ └── md5_checksumstring
│ ├── InputFileBig
│ │ ├── idlong
│ │ ├── partsint
│ │ └── namestring
│ └── idInputDocument
│ ├── InputDocumentEmpty
│ └── InputDocument
│ ├── idlong
│ ├── access_hashlong
│ └── file_referencebytes
├── videoInputFile (optional)
│ ├── InputFile
│ │ ├── idlong
│ │ ├── partsint
│ │ ├── namestring
│ │ └── md5_checksumstring
│ ├── InputFileBig
│ │ ├── idlong
│ │ ├── partsint
│ │ └── namestring
│ └── idInputDocument
│ ├── InputDocumentEmpty
│ └── InputDocument
│ ├── idlong
│ ├── access_hashlong
│ └── file_referencebytes
├── video_start_tsdouble (optional)
└── video_emoji_markupVideoSize (optional)
├── VideoSize
│ ├── typestring
│ ├── wint
│ ├── hint
│ ├── sizeint
│ └── video_start_tsdouble (optional)
│ ├── emoji_idlong
│ └── background_colorsVector < int >
├── stickersetInputStickerSet
│ ├── InputStickerSetEmpty
│ ├── InputStickerSetID
│ │ ├── idlong
│ │ └── access_hashlong
│ │ └── short_namestring
│ ├── InputStickerSetDice
│ │ └── emoticonstring
├── sticker_idlong
└── background_colorsVector < int >

Example

await app.invoke(
    UploadContactProfilePhoto(
        suggest=None,
        save=None,
        user_id=await app.resolve_user(chat_id),
        file=InputFile(
            id=0,
            parts=0,
            name="text",
            md5_checksum="text"
        ),
        video=InputFile(
            id=0,
            parts=0,
            name="text",
            md5_checksum="text"
        ),
        video_start_ts=0.0,
        video_emoji_markup=VideoSize(
            type="text",
            w=0,
            h=0,
            size=0,
            video_start_ts=None
        ),
    )
)