o
    Zzjo  ã                   @   s¨   d Z ddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ dd	lmZmZ er:dd
lmZ G dd„ deƒZG dd„ deƒZG dd„ deƒZdS )zSThis module contains an objects that represents a InputProfilePhoto and subclasses.é    N)ÚTYPE_CHECKING)Ú	constants)ÚTelegramObject)Úenum)Úto_timedelta)Úparse_file_input)Ú	FileInputÚJSONDict)Ú	InputFilec                       sL   e Zd ZdZejjZ	 ejjZ	 dZddœde	de
dB f‡ fdd„Z‡  ZS )	ÚInputProfilePhotoaD  This object describes a profile photo to set. Currently, it can be one of

    * :class:`InputProfilePhotoStatic`
    * :class:`InputProfilePhotoAnimated`

    .. versionadded:: 22.1

    Args:
        type (:obj:`str`): Type of the profile photo.

    Attributes:
        type (:obj:`str`): Type of the profile photo.

    )ÚtypeN©Ú
api_kwargsr   r   c                   s,   t ƒ j|d� t tj||¡| _|  ¡  d S )Nr   )ÚsuperÚ__init__r   Ú
get_memberr   ÚInputProfilePhotoTyper   Ú_freeze)Úselfr   r   ©Ú	__class__© ú\/var/www/kodo/tsheker/venv/lib/python3.10/site-packages/telegram/_files/inputprofilephoto.pyr   :   s   zInputProfilePhoto.__init__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚSTATICÚANIMATEDÚ	__slots__Ústrr	   r   Ú__classcell__r   r   r   r   r   #   s    üþür   c                       s8   e Zd ZdZdZddœdededB f‡ fdd„Z‡  ZS )	ÚInputProfilePhotoStatica¹  A static profile photo in the .JPG format.

    .. versionadded:: 22.1

    Args:
        photo (:term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` |             :class:`pathlib.Path`): The static profile photo. |uploadinputnopath|

    Attributes:
        type (:obj:`str`): :tg-const:`telegram.constants.InputProfilePhotoType.STATIC`.
        photo (:class:`telegram.InputFile` | :obj:`str`): The static profile photo.

    )ÚphotoNr   r#   r   c                   sR   t ƒ jtjj|d� |  ¡ � t|ddd�| _W d   ƒ d S 1 s"w   Y  d S ©N)r   r   T)ÚattachÚ
local_mode)r   r   r   r   r   Ú	_unfrozenr   r#   )r   r#   r   r   r   r   r   W   s   
"ýz InputProfilePhotoStatic.__init__)	r   r   r   r   r   r   r	   r   r!   r   r   r   r   r"   F   s    üþür"   c                	       sJ   e Zd ZdZdZ	d
ddœdedeejB dB de	dB f‡ fdd	„Z
‡  ZS )ÚInputProfilePhotoAnimatedab  An animated profile photo in the MPEG4 format.

    .. versionadded:: 22.1

    Args:
        animation (:term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` |             :class:`pathlib.Path`): The animated profile photo. |uploadinputnopath|
        main_frame_timestamp (:class:`datetime.timedelta` | :obj:`int` | :obj:`float`, optional):
            Timestamp in seconds of the frame that will be used as the static profile photo.
            Defaults to ``0.0``.

    Attributes:
        type (:obj:`str`): :tg-const:`telegram.constants.InputProfilePhotoType.ANIMATED`.
        animation (:class:`telegram.InputFile` | :obj:`str`): The animated profile photo.
        main_frame_timestamp (:class:`datetime.timedelta`): Optional. Timestamp in seconds of the
            frame that will be used as the static profile photo. Defaults to ``0.0``.
    )Ú	animationÚmain_frame_timestampNr   r)   r*   r   c                   s\   t ƒ jtjj|d� |  ¡ � t|ddd�| _t|ƒ| _	W d   ƒ d S 1 s'w   Y  d S r$   )
r   r   r   r   r   r'   r   r)   r   r*   )r   r)   r*   r   r   r   r   r   y   s   
ÿ"ùz"InputProfilePhotoAnimated.__init__)N)r   r   r   r   r   r   ÚfloatÚdtmÚ	timedeltar	   r   r!   r   r   r   r   r(   d   s    ýûþýûr(   )r   Údatetimer,   Útypingr   Útelegramr   Útelegram._telegramobjectr   Útelegram._utilsr   Útelegram._utils.argumentparsingr   Útelegram._utils.filesr   Útelegram._utils.typesr   r	   r
   r   r"   r(   r   r   r   r   Ú<module>   s   #