o
    XzjŽ  ã                
   @   sô   d dl mZ ejejejejejejejf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G d
d„ deƒ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G dd„ deƒZeZdd„ eeeeeeeeef	D ƒZdS )é   )Ú	functionsc                       s>   e Zd ZdZdZdZd	‡ fdd„	Zedd„ ƒZdd„ Z	‡  Z
S )
ÚRPCErrorz0Base class for all Remote Procedure Call errors.Nc              	      s8   t ƒ  d |p	| j||  |¡¡¡ || _|| _|| _d S )NzRPCError {}: {}{})ÚsuperÚ__init__ÚformatÚcodeÚ_fmt_requestÚrequestÚmessage)Úselfr	   r
   r   ©Ú	__class__© úX/var/www/kodo/tsheker/venv/lib/python3.10/site-packages/telethon/errors/rpcbaseerrors.pyr      s   
ÿ
zRPCError.__init__c                 C   sX   d}d}t | tƒr|d7 }|| jjd 7 }| j} t | tƒs	|| jjd|  7 }d |¡S )Né    Ú é   ú(ú)z (caused by {}))Ú
isinstanceÚ_NESTS_QUERYr   Ú__name__Úqueryr   )r	   ÚnÚreasonr   r   r   r      s   

ý
zRPCError._fmt_requestc                 C   s   t | ƒ| j| j| jffS ©N)Útyper	   r
   r   )r   r   r   r   Ú
__reduce__&   s   zRPCError.__reduce__r   )r   Ú
__module__Ú__qualname__Ú__doc__r   r
   r   Ústaticmethodr   r   Ú__classcell__r   r   r   r   r      s    
r   c                   @   ó   e Zd ZdZdZdZdS )ÚInvalidDCErrorzP
    The request must be repeated, but directed to a different data center.
    i/  ÚERROR_SEE_OTHERN©r   r   r   r    r   r
   r   r   r   r   r$   *   ó    r$   c                   @   r#   )ÚBadRequestErrorzÝ
    The query contains errors. In the event that a request was created
    using a form and contains user generated data, the user should be
    notified that the data must be corrected before the query is repeated.
    i�  ÚBAD_REQUESTNr&   r   r   r   r   r(   2   ó    r(   c                   @   r#   )ÚUnauthorizedErrorzh
    There was an unauthorized attempt to use functionality available only
    to authorized users.
    i‘  ÚUNAUTHORIZEDNr&   r   r   r   r   r+   <   ó    r+   c                   @   r#   )ÚForbiddenErrorz|
    Privacy violation. For example, an attempt to write a message to
    someone who has blacklisted the current user.
    i“  Ú	FORBIDDENNr&   r   r   r   r   r.   E   r-   r.   c                   @   r#   )ÚNotFoundErrorzG
    An attempt to invoke a non-existent object, such as a method.
    i”  Ú	NOT_FOUNDNr&   r   r   r   r   r0   N   r'   r0   c                   @   r#   )ÚAuthKeyErrorz{
    Errors related to invalid authorization key, like
    AUTH_KEY_DUPLICATED which can cause the connection to fail.
    i–  ÚAUTH_KEYNr&   r   r   r   r   r2   V   r-   r2   c                   @   r#   )Ú
FloodErrorzñ
    The maximum allowed number of attempts to invoke the given method
    with the given input parameters has been exceeded. For example, in an
    attempt to request a large number of text messages (SMS) for the same
    phone number.
    i¤  ÚFLOODNr&   r   r   r   r   r4   _   s    r4   c                   @   r#   )ÚServerErrorz§
    An internal server error occurred while a request was being processed
    for example, there was a disruption while accessing a database or file
    storage.
    iô  ÚINTERNALNr&   r   r   r   r   r6   j   r*   r6   c                   @   r#   )ÚTimedOutErrorz–
    Clicking the inline buttons of bots that never (or take to long to)
    call ``answerCallbackQuery`` will result in this "special" RPCError.
    i÷  ÚTimeoutNr&   r   r   r   r   r8   t   r-   r8   c                 C   s   i | ]}|j |“qS r   )r   )Ú.0Úxr   r   r   Ú
<dictcomp>€   s    r<   N)Útlr   ÚInvokeAfterMsgRequestÚInvokeAfterMsgsRequestÚInitConnectionRequestÚInvokeWithLayerRequestÚInvokeWithoutUpdatesRequestÚInvokeWithMessagesRangeRequestÚInvokeWithTakeoutRequestr   Ú	Exceptionr   r$   r(   r+   r.   r0   r2   r4   r6   r8   Ú
BotTimeoutÚbase_errorsr   r   r   r   Ú<module>   s0    ù

			
	
þ