
    N[i
                     <    d dl mZmZ d dlZd dlmZ  G d d      Zy)    )UnionBinaryION)rawc            	       @    e Zd Zddddddeeef   deeef   defdZy)	SetProfilePhotoN)photovideoselfzpyrogram.Clientr   r	   returnc          
        K   t        | j                  t        j                  j                  j                  | j                  |       d{   | j                  |       d{                d{         S 7 17 7 w)a?  Set a new profile photo or video (H.264/MPEG-4 AVC video, max 5 seconds).

        The ``photo`` and ``video`` arguments are mutually exclusive.
        Pass either one as named argument (see examples below).

        .. note::

            This method only works for Users.
            Bots profile photos must be set using BotFather.

        .. include:: /_includes/usable-by/users.rst

        Parameters:
            photo (``str`` | ``BinaryIO``, *optional*):
                Profile photo to set.
                Pass a file path as string to upload a new photo that exists on your local machine or
                pass a binary file-like object with its attribute ".name" set for in-memory uploads.

            video (``str`` | ``BinaryIO``, *optional*):
                Profile video to set.
                Pass a file path as string to upload a new video that exists on your local machine or
                pass a binary file-like object with its attribute ".name" set for in-memory uploads.

        Returns:
            ``bool``: True on success.

        Example:
            .. code-block:: python

                # Set a new profile photo
                await app.set_profile_photo(photo="new_photo.jpg")

                # Set a new profile video
                await app.set_profile_photo(video="new_video.mp4")
        N)filer	   )boolinvoker   	functionsphotosUploadProfilePhoto	save_file)r
   r   r	   s      [/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/users/set_profile_photo.pyset_profile_photoz!SetProfilePhoto.set_profile_photo   sq     T ++$$77#~~e44 $u 55 8  
 	
 55s6   AB
A<B"A>#B3B 4	B>B B)__name__
__module____qualname__r   strr   r   r        r   r   r      sG     '+&*	1
1
 S(]#1
 S(]#	1

 
1
r   r   )typingr   r   pyrogramr   r   r   r   r   <module>r      s   & #  2
 2
r   