o
    -˜Žj  ã                   @   s:   d dl mZmZmZ d dlZd dlmZ G dd„ dƒZdS )é    )ÚUnionÚBinaryIOÚListN)Úrawc                   @   sV   e Zd Zdddddœdddeeef dedeeee f deeef d	efd
d„Z	dS )ÚSetProfilePhotoN)ÚphotoÚemojiÚemoji_backgroundÚvideoÚselfzpyrogram.Clientr   r   r	   r
   Úreturnc             	   Ã   sx   �d}|r|dur|ndg}t |tƒr|g}tjj||d�}t|  tjjj	|  
|¡I dH ||  
|¡I dH d�¡I dH ƒS )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 bots method only works for photo only.

        .. include:: /_includes/usable-by/users-bots.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.

            emoji (``int``, *optional*):
                Unique identifier (int) of the emoji to be used as the profile photo.

            emoji_background (``int`` | ``List[int]``, *optional*):
                hexadecimal colors or List of hexadecimal colors to be used as the chat photo background.

            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")
        Niÿÿÿ )Úemoji_idÚbackground_colors)ÚfileÚvideo_emoji_markupr
   )Ú
isinstanceÚintr   ÚtypesÚVideoSizeEmojiMarkupÚboolÚinvokeÚ	functionsÚphotosÚUploadProfilePhotoÚ	save_file)r   r   r   r	   r
   r   r   © r   úe/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/users/set_profile_photo.pyÚset_profile_photo   s&   €1
þýÿÿz!SetProfilePhoto.set_profile_photo)
Ú__name__Ú
__module__Ú__qualname__r   Ústrr   r   r   r   r   r   r   r   r   r      s$    úÿ
ýüû
úùr   )Útypingr   r   r   Úpyrogramr   r   r   r   r   r   Ú<module>   s   