§
    «eîic   ã                   ón  — 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dS )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                   ól   ‡ — 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          ¦   «                              ¦   «          |                     d¦  «        }|                     d¦  «        }|                     d¦  «        }||k    r|                     ¦   «         }|| _        d S )NzError: z	[Error]: zBad Request: )ÚsuperÚ__init__ÚremoveprefixÚ
capitalizer   )Úselfr   ÚmsgÚ	__class__s      €úR/home/div/.hermes/hermes-agent/venv/lib/python3.11/site-packages/telegram/error.pyr   zTelegramError.__init__=   su   ø€ Ý‰Œ×ÒÑÔÐà×"Ò" 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                 ó0   — | 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¬\Ð=Ð=Ð=Ð=r   c                 ó    — | 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   .   s´   ø€ € € € € ð
ð 
ð €Ið	  ð 	 ð 	 ð 	 ð 	 ð 	 ð 	 ð˜ð ð ð ð ð>˜#ð >ð >ð >ð >ð	/˜E $¨¨c¬
Ð"2Ô3ð 	/ð 	/ð 	/ð 	/ð 	/ð 	/ð 	/ð 	/r   r   c                   ó   — e Zd ZdZdZdS )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   € € € € € ðð ð €I€I€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                 óR   •— t          ¦   «                              |€dn|¦  «         d S )NzInvalid token©r   r   ©r   r   r   s     €r   r   zInvalidToken.__init__|   s)   ø€ Ý‰Œ×Ò¨G¨O˜˜ÀÑIÔIÐIÐIÐIr   ©N©r#   r(   r)   r*   r+   r,   r   r/   r0   s   @r   r   r   q   sr   ø€ € € € € ðð ð €IðJð J  d¡
ð J°dð Jð Jð Jð Jð Jð Jð Jð Jð Jð Jr   r   c                   ó   — e Zd ZdZdZdS )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   € € € € € ðð ð €I€I€Ir   r	   c                   ó   — e Zd ZdZdZdS )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   € € € € € ðð ð  €I€I€Ir   r   c                   ó   — e Zd ZdZdZdS )r   z=Raised when Telegram could not process the request correctly.r2   Nr3   r2   r   r   r   r   ž   s   € € € € € ØGÐGà€I€I€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                 óN   •— t          ¦   «                              |pd¦  «         d S )Nz	Timed outr6   r7   s     €r   r   zTimedOut.__init__²   s&   ø€ Ý‰Œ×Ò˜Ð/ KÑ0Ô0Ð0Ð0Ð0r   r8   r9   r0   s   @r   r   r   ¤   se   ø€ € € € € ð	ð 	ð €Ið1ð 1  d¡
ð 1°dð 1ð 1ð 1ð 1ð 1ð 1ð 1ð 1ð 1ð 1r   r   c                   óT   ‡ — 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                 ó^   •— t          ¦   «                              d|› �¦  «         || _        d S )Nz+Group migrated to supergroup. New chat id: )r   r   r@   )r   r@   r   s     €r   r   zChatMigrated.__init__Ç   s2   ø€ Ý‰Œ×ÒÐTÀ{ÐTÐTÑUÔUÐUØ +ˆÔÐÐr   r   c                 ó    — | j         | j        ffS r8   )r   r@   r    s    r   r'   zChatMigrated.__reduce__Ë   s   € ØŒ~ Ô 0Ð2Ð2Ð2r   )r#   r(   r)   r*   r+   Úintr   r-   r.   r'   r/   r0   s   @r   r   r   ¶   s~   ø€ € € € € ðð ð !€Ið, Cð ,ð ,ð ,ð ,ð ,ð ,ð3˜E $¨¨c¬
Ð"2Ô3ð 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3r   r   c                   ó€   ‡ — 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�¦  «         d S t          ¦   «                              d| j        ›�¦  «         d S )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ˆÔå�dÔ&­Ñ,Ô,ð 	WÝ‰GŒG×ÒÐ[ÀÔAQÐ[Ð[Ð[Ñ\Ô\Ð\Ð\Ð\å‰GŒG×ÒÐUÀÔAQÐUÐUÑVÔVÐVÐVÐVr   r   c                 ó.   — t          | j        d¬¦  «        S )NrF   )Ú	attribute)r   rE   r    s    r   rF   zRetryAfter.retry_afterð   s#   € õ #ØÔ¨ð
ñ 
ô 
ð 	
r   c                 ó^   — | j         t          | j                             ¦   «         ¦  «        ffS r8   )r   rC   rE   Útotal_secondsr    s    r   r'   zRetryAfter.__reduce__÷   s+   € ð Œ~¥ DÔ$5×$CÒ$CÑ$EÔ$EÑ FÔ 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ð Wð Wð Wð Wð Wð ð
˜S 3¤=Ñ0ð 
ð 
ð 
ñ „Xð
ðI˜E $¨¨e¬Ð"4Ô5ð Ið Ið Ið Ið Ið Ið Ið Ir   r   c                   ó>   — e Zd ZdZdZdeeee         f         fd„ZdS )r   z>Raised when a long poll or webhook conflicts with another one.r2   r   c                 ó    — | 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   ý   sH   € € € € € ØHÐHà€Ið/˜E $¨¨c¬
Ð"2Ô3ð /ð /ð /ð /ð /ð /r   r   c                   óZ   ‡ — 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                 óx   •— t          ¦   «                              d|› �¦  «         t          |¦  «        | _        d S )NzPassportDecryptionError: )r   r   r,   rT   r7   s     €r   r   z PassportDecryptionError.__init__  s5   ø€ Ý‰Œ×ÒÐ>°WÐ>Ð>Ñ?Ô?Ð?Ý˜‘L”LˆŒ	ˆ	ˆ	r   r   c                 ó    — | 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     s‚   ø€ € € € € ðð ð €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]      sD  ðð&ð ð Ð Ð Ð à 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,ð€ð3/ð 3/ð 3/ð 3/ð 3/�Iñ 3/ô 3/ð 3/ðl
ð 
ð 
ð 
ð 
�ñ 
ô 
ð 
ðJð Jð Jð Jð J�=ñ Jô Jð Jðð ð ð ð �}ñ ô ð ðð ð ð ð �=ñ ô ð ð(ð ð ð ð �ñ ô ð ð1ð 1ð 1ð 1ð 1ˆ|ñ 1ô 1ð 1ð$3ð 3ð 3ð 3ð 3�=ñ 3ô 3ð 3ð2+Ið +Ið +Ið +Ið +I�ñ +Iô +Ið +Ið\/ð /ð /ð /ð /ˆ}ñ /ô /ð /ð,ð ,ð ,ð ,ð ,˜mñ ,ô ,ð ,ð ,ð ,r   