Ë
    †jc   ã                   ó*  — d Z ddlZddlmZ ddlmZ ddlmZ dZ	 G d„ de
«      Z G d	„ d
e«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zy)zŒThis module contains classes that represent Telegram errors.

.. versionchanged:: 20.0
    Replaced ``Unauthorized`` by :class:`Forbidden`.
é    N)Úto_timedelta)Úget_timedelta_value)Ú
TimePeriod)Ú
BadRequestÚChatMigratedÚConflictÚEndPointNotFoundÚ	ForbiddenÚInvalidTokenÚNetworkErrorÚPassportDecryptionErrorÚ
RetryAfterÚTelegramErrorÚTimedOutc                   ó`   ‡ — e Zd ZdZdZdefˆ fd„Zdefd„Zdefd„Zde	e
e	e   f   fd„Zˆ xZS )	r   a  
    Base class for Telegram errors.

    Tip:
        Objects of this type can be serialized via Python's :mod:`pickle` module and pickled
        objects from one version of PTB are usually loadable in future versions. However, we can
        not guarantee that this compatibility will always be provided. At least a manual one-time
        conversion of the data may be needed on major updates of the library.

    .. seealso:: :wiki:`Exceptions, Warnings and Logging <Exceptions%2C-Warnings-and-Logging>`
    ©Úmessager   c                 óÀ   •— t         ‰| �  «        |j                  d«      }|j                  d«      }|j                  d«      }||k7  r|j                  «       }|| _        y )NzError: z	[Error]: zBad Request: )ÚsuperÚ__init__ÚremoveprefixÚ
capitalizer   )Úselfr   ÚmsgÚ	__class__s      €úM/var/www/html/datingFans/myenv/lib/python3.12/site-packages/telegram/error.pyr   zTelegramError.__init__=   sX   ø€ Ü‰ÑÔà×"Ñ" 9Ó-ˆØ×Ñ˜{Ó+ˆØ×Ñ˜Ó/ˆØ�'Š>à—.‘.Ó"ˆCØˆ�ó    Úreturnc                 ó   — | j                   S )zgGives the string representation of exceptions message.

        Returns:
           :obj:`str`
        r   ©r   s    r   Ú__str__zTelegramError.__str__H   s   € ð �|‰|Ðr   c                 óN   — | j                   j                  › d| j                  › d�S )zmGives an unambiguous string representation of the exception.

        Returns:
           :obj:`str`
        z('z'))r   Ú__name__r   r    s    r   Ú__repr__zTelegramError.__repr__P   s&   € ð —.‘.×)Ñ)Ð*¨"¨T¯\©\¨N¸"Ð=Ð=r   c                 ó4   — | j                   | j                  ffS )z¸Defines how to serialize the exception for pickle.

        .. seealso::
               :py:meth:`object.__reduce__`, :mod:`pickle`.

        Returns:
            :obj:`tuple`
        ©r   r   r    s    r   Ú
__reduce__zTelegramError.__reduce__X   s   € ð �~‰~ §¡˜Ð.Ð.r   )r#   Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__Ústrr   r!   r$   ÚtupleÚtyper'   Ú__classcell__©r   s   @r   r   r   .   sM   ø„ ñ
ð €Ið	  õ 	 ð˜ó ð>˜#ó >ð	/˜E $¨¨c©
Ð"2Ñ3÷ 	/r   r   c                   ó   — e Zd ZdZdZy)r
   zæRaised when the bot has not enough rights to perform the requested action.

    Examples:
        :any:`Raw API Bot <examples.rawapibot>`

    .. versionchanged:: 20.0
        This class was previously named ``Unauthorized``.
    © N©r#   r(   r)   r*   r+   r2   r   r   r
   r
   d   s   „ ñð �Ir   r
   c                   ó8   ‡ — e Zd ZdZdZddedz  ddfˆ fd„Zˆ xZS )r   z­Raised when the token is invalid.

    Args:
        message (:obj:`str`, optional): Any additional information about the exception.

            .. versionadded:: 20.0
    r2   Nr   r   c                 ó6   •— t         ‰| �  |€d«       y |«       y )NzInvalid token©r   r   ©r   r   r   s     €r   r   zInvalidToken.__init__|   s   ø€ Ü‰Ñ¨G¨O˜ÕIÀÕIr   ©N©r#   r(   r)   r*   r+   r,   r   r/   r0   s   @r   r   r   q   s/   ø„ ñð €IñJ  d¡
ð J°d÷ Jñ Jr   r   c                   ó   — e Zd ZdZdZy)r	   zŒRaised when the requested endpoint is not found. Only relevant for
    :meth:`telegram.Bot.do_api_request`.

    .. versionadded:: 20.8
    r2   Nr3   r2   r   r   r	   r	   €   s   „ ñð �Ir   r	   c                   ó   — e Zd ZdZdZy)r   af  Base class for exceptions due to networking errors.

    Tip:
        This exception (and its subclasses) usually originates from the networking backend
        used by :class:`~telegram.request.HTTPXRequest`, or a custom implementation of
        :class:`~telegram.request.BaseRequest`. In this case, the original exception can be
        accessed via the ``__cause__``
        `attribute <https://docs.python.org/3/library/exceptions.html#exception-context>`_.

    Examples:
        :any:`Raw API Bot <examples.rawapibot>`

    .. seealso::
        :wiki:`Handling network errors <Handling-network-errors>`
    r2   Nr3   r2   r   r   r   r   Š   s   „ ñð  �Ir   r   c                   ó   — e Zd ZdZdZy)r   z=Raised when Telegram could not process the request correctly.r2   Nr3   r2   r   r   r   r   ž   s
   „ ÙGà�Ir   r   c                   ó8   ‡ — e Zd ZdZdZddedz  ddfˆ fd„Zˆ xZS )r   a  Raised when a request took too long to finish.

    .. seealso::
        :wiki:`Handling network errors <Handling-network-errors>`

    Args:
        message (:obj:`str`, optional): Any additional information about the exception.

            .. versionadded:: 20.0
    r2   Nr   r   c                 ó,   •— t         ‰| �  |xs d«       y )Nz	Timed outr6   r7   s     €r   r   zTimedOut.__init__²   s   ø€ Ü‰Ñ˜Ò/ KÕ0r   r8   r9   r0   s   @r   r   r   ¤   s+   ø„ ñ	ð €Iñ1  d¡
ð 1°d÷ 1ñ 1r   r   c                   óH   ‡ — e Zd ZdZdZdefˆ fd„Zdeeee   f   fd„Z	ˆ xZ
S )r   ao  
    Raised when the requested group chat migrated to supergroup and has a new chat id.

    .. seealso::
        :wiki:`Storing Bot, User and Chat Related Data <Storing-bot%2C-user-and-chat-related-data>`

    Args:
        new_chat_id (:obj:`int`): The new chat id of the group.

    Attributes:
        new_chat_id (:obj:`int`): The new chat id of the group.

    )Únew_chat_idr@   c                 ó8   •— t         ‰| �  d|› �«       || _        y )Nz+Group migrated to supergroup. New chat id: )r   r   r@   )r   r@   r   s     €r   r   zChatMigrated.__init__Ç   s    ø€ Ü‰ÑÐFÀ{ÀmÐTÔUØ +ˆÕr   r   c                 ó4   — | j                   | j                  ffS r8   )r   r@   r    s    r   r'   zChatMigrated.__reduce__Ë   s   € Ø�~‰~ × 0Ñ 0Ð2Ð2Ð2r   )r#   r(   r)   r*   r+   Úintr   r-   r.   r'   r/   r0   s   @r   r   r   ¶   s5   ø„ ñð !€Ið, Cõ ,ð3˜E $¨¨c©
Ð"2Ñ3÷ 3r   r   c                   óx   ‡ — e Zd ZdZdZdefˆ fd„Zedee	j                  z  fd„«       Zdeeee   f   fd„Zˆ xZS )r   aa  
    Raised when flood limits where exceeded.

    .. versionchanged:: 20.0
       :attr:`retry_after` is now an integer to comply with the Bot API.

    Args:
        retry_after (:obj:`int` | :class:`datetime.timedelta`): Time in seconds, after which the
            bot can retry the request.

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

    Attributes:
        retry_after (:obj:`int` | :class:`datetime.timedelta`): Time in seconds, after which the
            bot can retry the request.

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

    )Ú_retry_afterÚretry_afterc                 óÎ   •— t        |«      | _        t        | j                  t        «      rt
        ‰| �  d| j                  › d�«       y t
        ‰| �  d| j                  ›�«       y )Nz!Flood control exceeded. Retry in z seconds)r   rE   Ú
isinstancerF   rC   r   r   )r   rF   r   s     €r   r   zRetryAfter.__init__è   s[   ø€ Ü+7¸Ó+DˆÔä�d×&Ñ&¬Ô,Ü‰GÑÐ@À×AQÑAQÐ@RÐRZÐ[Õ\ä‰GÑÐ@À×AQÑAQÐ@TÐUÕVr   r   c                 ó0   — t        | j                  d¬«      S )NrF   )Ú	attribute)r   rE   r    s    r   rF   zRetryAfter.retry_afterð   s   € ô #Ø×Ñ¨ô
ð 	
r   c                 ób   — | j                   t        | j                  j                  «       «      ffS r8   )r   rC   rE   Útotal_secondsr    s    r   r'   zRetryAfter.__reduce__÷   s*   € ð �~‰~¤ D×$5Ñ$5×$CÑ$CÓ$EÓ FÐHÐHÐHr   )r#   r(   r)   r*   r+   r   r   ÚpropertyrC   ÚdtmÚ	timedeltarF   r-   r.   Úfloatr'   r/   r0   s   @r   r   r   Ï   s]   ø„ ñð, "€IðW Jõ Wð ð
˜S 3§=¡=Ñ0ò 
ó ð
ðI˜E $¨¨e©Ð"4Ñ5÷ Ir   r   c                   ó0   — e Zd ZdZdZdeeee   f   fd„Zy)r   z>Raised when a long poll or webhook conflicts with another one.r2   r   c                 ó4   — | j                   | j                  ffS r8   r&   r    s    r   r'   zConflict.__reduce__  s   € Ø�~‰~ §¡˜Ð.Ð.r   N)	r#   r(   r)   r*   r+   r-   r.   r,   r'   r2   r   r   r   r   ý   s$   „ ÙHà€Ið/˜E $¨¨c©
Ð"2Ñ3ô /r   r   c                   óN   ‡ — e Zd ZdZdZdeez  fˆ fd„Zdee	ee   f   fd„Z
ˆ xZS )r   zÐSomething went wrong with decryption.

    .. versionchanged:: 20.0
        This class was previously named ``TelegramDecryptionError`` and was available via
        ``telegram.TelegramDecryptionError``.
    )Ú_msgr   c                 óJ   •— t         ‰| �  d|› �«       t        |«      | _        y )NzPassportDecryptionError: )r   r   r,   rT   r7   s     €r   r   z PassportDecryptionError.__init__  s#   ø€ Ü‰ÑÐ4°W°IÐ>Ô?Ü˜“Lˆ�	r   r   c                 ó4   — | j                   | j                  ffS r8   )r   rT   r    s    r   r'   z"PassportDecryptionError.__reduce__  s   € Ø�~‰~ §	¡	˜|Ð+Ð+r   )r#   r(   r)   r*   r+   r,   Ú	Exceptionr   r-   r.   r'   r/   r0   s   @r   r   r     s9   ø„ ñð €Ið!  i¡õ !ð,˜E $¨¨c©
Ð"2Ñ3÷ ,r   r   )r*   ÚdatetimerN   Útelegram._utils.argumentparsingr   Útelegram._utils.datetimer   Útelegram._utils.typesr   Ú__all__rW   r   r
   r   r	   r   r   r   r   r   r   r   r2   r   r   ú<module>r]      s©   ðñ&ó å 8Ý 8Ý ,ð€ô3/�Iô 3/ôl
�ô 
ôJ�=ô Jô�}ô ô�=ô ô(�ô ô1ˆ|ô 1ô$3�=ô 3ô2+I�ô +Iô\/ˆ}ô /ô,˜mõ ,r   