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: 227

  • 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
├── suggest → true (optional)
├── save → true (optional)
├── user_id → InputUser
│ ├── InputUserEmpty
│ ├── InputUserSelf
│ ├── InputUser
│ │ ├── user_id → long
│ │ └── access_hash → long
│ └── InputUserFromMessage
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── user_id → long
├── file → InputFile (optional)
│ ├── InputFile
│ │ ├── id → long
│ │ ├── parts → int
│ │ ├── name → string
│ │ └── md5_checksum → string
│ ├── InputFileBig
│ │ ├── id → long
│ │ ├── parts → int
│ │ └── name → string
│ └── id → InputDocument
│ ├── InputDocumentEmpty
│ └── InputDocument
│ ├── id → long
│ ├── access_hash → long
│ └── file_reference → bytes
├── video → InputFile (optional)
│ ├── InputFile
│ │ ├── id → long
│ │ ├── parts → int
│ │ ├── name → string
│ │ └── md5_checksum → string
│ ├── InputFileBig
│ │ ├── id → long
│ │ ├── parts → int
│ │ └── name → string
│ └── id → InputDocument
│ ├── InputDocumentEmpty
│ └── InputDocument
│ ├── id → long
│ ├── access_hash → long
│ └── file_reference → bytes
├── video_start_ts → double (optional)
└── video_emoji_markup → VideoSize (optional)
├── VideoSize
│ ├── type → string
│ ├── w → int
│ ├── h → int
│ ├── size → int
│ └── video_start_ts → double (optional)
│ ├── emoji_id → long
│ └── background_colors → Vector < int >
├── stickerset → InputStickerSet
│ ├── InputStickerSetEmpty
│ ├── InputStickerSetID
│ │ ├── id → long
│ │ └── access_hash → long
│ │ └── short_name → string
│ ├── InputStickerSetDice
│ │ └── emoticon → string
├── sticker_id → long
└── background_colors → Vector < 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
        ),
    )
)