o
    Zzjì  ã                   @   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mZ ddlmZmZ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G dd„ deƒZdS )z=This module contains objects related to Telegram video chats.é    N)ÚSequence)ÚTYPE_CHECKING)ÚTelegramObject)ÚUser)Úparse_sequence_argÚto_timedelta)Úextract_tzinfo_from_defaultsÚfrom_timestampÚget_timedelta_value)ÚJSONDictÚ
TimePeriod)ÚBotc                       s8   e Zd ZdZdZddœdedB ddf‡ fdd„Z‡  ZS )	ÚVideoChatStarteda  
    This object represents a service message about a video
    chat started in the chat. Currently holds no information.

    .. versionadded:: 13.4
    .. versionchanged:: 20.0
        This class was renamed from ``VoiceChatStarted`` in accordance to Bot API 6.0.
    © N©Ú
api_kwargsr   Úreturnc                   s   t ƒ j|d� |  ¡  d S ©Nr   )ÚsuperÚ__init__Ú_freeze)Úselfr   ©Ú	__class__r   úN/var/www/kodo/tsheker/venv/lib/python3.10/site-packages/telegram/_videochat.pyr   3   s   zVideoChatStarted.__init__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r   Ú__classcell__r   r   r   r   r   '   s    	(r   c                       sT   e Zd ZdZdZddœdededB ddf‡ fdd	„Zede	e
jB fd
d„ƒZ‡  ZS )ÚVideoChatEndedaÞ  
    This object represents a service message about a
    video chat ended in the chat.

    Objects of this class are comparable in terms of equality.
    Two objects of this class are considered equal, if their
    :attr:`duration` are equal.

    .. versionadded:: 13.4
    .. versionchanged:: 20.0
        This class was renamed from ``VoiceChatEnded`` in accordance to Bot API 6.0.

    .. versionchanged:: v22.2
       As part of the migration to representing time periods using ``datetime.timedelta``,
       equality comparison now considers integer durations and equivalent timedeltas as equal.

    Args:
        duration (:obj:`int` | :class:`datetime.timedelta`): Voice chat duration
            in seconds.

            .. versionchanged:: v22.2
                |time-period-input|

    Attributes:
        duration (:obj:`int` | :class:`datetime.timedelta`): Voice chat duration in seconds.

            .. deprecated:: v22.2
                |time-period-int-deprecated|

    )Ú	_durationNr   Údurationr   r   c                   ó.   t ƒ j|d� t|ƒ| _| jf| _|  ¡  d S r   )r   r   r   r"   Ú	_id_attrsr   )r   r#   r   r   r   r   r   [   ó   

zVideoChatEnded.__init__c                 C   s   t | jdd�S )Nr#   )Ú	attribute)r
   r"   )r   r   r   r   r#   g   s   ÿzVideoChatEnded.duration)r   r   r   r   r   r   r   r   ÚpropertyÚintÚdtmÚ	timedeltar#   r    r   r   r   r   r!   9   s    üþüûr!   c                       s`   e Zd ZdZdZddœdee dedB ddf‡ fdd	„Ze	dd
edddd f‡ fdd„ƒZ
‡  ZS )ÚVideoChatParticipantsInviteda  
    This object represents a service message about new members invited to a video chat.

    Objects of this class are comparable in terms of equality.
    Two objects of this class are considered equal, if their :attr:`users` are equal.

    .. versionadded:: 13.4
    .. versionchanged:: 20.0
        This class was renamed from ``VoiceChatParticipantsInvited`` in accordance to Bot API 6.0.

    Args:
        users (Sequence[:class:`telegram.User`]): New members that were invited to the video chat.

            .. versionchanged:: 20.0
                |sequenceclassargs|

    Attributes:
        users (tuple[:class:`telegram.User`]): New members that were invited to the video chat.

            .. versionchanged:: 20.0
                |tupleclassattrs|

    )ÚusersNr   r-   r   r   c                   r$   r   )r   r   r   r-   r%   r   )r   r-   r   r   r   r   r   ‰   r&   z%VideoChatParticipantsInvited.__init__ÚdataÚbotú
Bot | Nonec                    s2   |   |¡}t | dg ¡|¡|d< tƒ j||d�S )ú,See :meth:`telegram.TelegramObject.de_json`.r-   ©r.   r/   )Ú_parse_datar   Úde_listÚgetr   Úde_json)Úclsr.   r/   r   r   r   r6   •   s   
z$VideoChatParticipantsInvited.de_json©N)r   r   r   r   r   r   r   r   r   Úclassmethodr6   r    r   r   r   r   r,   n   s    üþüû&r,   c                       s^   e Zd ZdZdZddœdejdedB ddf‡ fdd	„Ze	dd
edddd f‡ fdd„ƒZ
‡  ZS )ÚVideoChatScheduledaa  This object represents a service message about a video chat scheduled in the chat.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`start_date` are equal.

    .. versionchanged:: 20.0
        This class was renamed from ``VoiceChatScheduled`` in accordance to Bot API 6.0.

    Args:
        start_date (:obj:`datetime.datetime`): Point in time (Unix timestamp) when the video
            chat is supposed to be started by a chat administrator

            .. versionchanged:: 20.3
                |datetime_localization|
    Attributes:
        start_date (:obj:`datetime.datetime`): Point in time (Unix timestamp) when the video
            chat is supposed to be started by a chat administrator

            .. versionchanged:: 20.3
                |datetime_localization|

    )Ú
start_dateNr   r;   r   r   c                   s*   t ƒ j|d� || _| jf| _|  ¡  d S r   )r   r   r;   r%   r   )r   r;   r   r   r   r   r   ¸   s   
zVideoChatScheduled.__init__r.   r/   r0   c                    s8   |   |¡}t|ƒ}t| d¡|d�|d< tƒ j||d�S )r1   r;   )Útzinfor2   )r3   r   r	   r5   r   r6   )r7   r.   r/   Ú
loc_tzinfor   r   r   r6   Å   s   
zVideoChatScheduled.de_jsonr8   )r   r   r   r   r   r*   Údatetimer   r   r9   r6   r    r   r   r   r   r:   ž   s    üþüû&r:   )r   r>   r*   Úcollections.abcr   Útypingr   Útelegram._telegramobjectr   Útelegram._userr   Útelegram._utils.argumentparsingr   r   Útelegram._utils.datetimer   r	   r
   Útelegram._utils.typesr   r   Útelegramr   r   r!   r,   r:   r   r   r   r   Ú<module>   s   50