
    ;Si              	          d dl mZ ej                  ej                  ej                  ej
                  ej                  ej                  ej                  f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eZeeeeeeeeef	D  ci c]  } | j,                  |  c} Zyc c} w )   )	functionsc                   B     e Zd ZdZdZdZd fd	Zed        Zd Z	 xZ
S )RPCErrorz0Base class for all Remote Procedure Call errors.Nc           	          t         |   dj                  |xs | j                  || j	                  |                   || _        || _        || _        y )NzRPCError {}: {}{})super__init__formatcode_fmt_requestrequestmessage)selfr   r   r
   	__class__s       b/var/www/OnlineNewsSite/project/venv/lib/python3.12/site-packages/telethon/errors/rpcbaseerrors.pyr   zRPCError.__init__   sR    ,33DIIw(9(9'(BD 	E 	    c                    d}d}t        | t              r>|dz  }|| j                  j                  dz   z  }| j                  } t        | t              r>|| j                  j                  d|z  z   z  }dj                  |      S )N        ()z (caused by {}))
isinstance_NESTS_QUERYr   __name__queryr	   )r   nreasons      r   r   zRPCError._fmt_request   s    ,/FAg''00366FmmG ,/ 	'##,,sQw66 ''//r   c                 ^    t        |       | j                  | j                  | j                  ffS N)typer   r   r
   )r   s    r   
__reduce__zRPCError.__reduce__&   s$    DzDLL$,,		BBBr   r   )r   
__module____qualname____doc__r
   r   r   staticmethodr   r!   __classcell__)r   s   @r   r   r      s/    :DG 	0 	0Cr   r   c                       e Zd ZdZdZdZy)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(   *   s     DGr   r(   c                       e Zd ZdZdZdZy)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   s    
 DGr   r-   c                       e Zd ZdZdZdZy)UnauthorizedErrorzh
    There was an unauthorized attempt to use functionality available only
    to authorized users.
    i  UNAUTHORIZEDNr*   r+   r   r   r0   r0   <   s     DGr   r0   c                       e Zd ZdZdZdZy)ForbiddenErrorz|
    Privacy violation. For example, an attempt to write a message to
    someone who has blacklisted the current user.
    i  	FORBIDDENNr*   r+   r   r   r3   r3   E   s     DGr   r3   c                       e Zd ZdZdZdZy)NotFoundErrorzG
    An attempt to invoke a non-existent object, such as a method.
    i  	NOT_FOUNDNr*   r+   r   r   r6   r6   N   s     DGr   r6   c                       e Zd ZdZdZdZy)AuthKeyErrorz{
    Errors related to invalid authorization key, like
    AUTH_KEY_DUPLICATED which can cause the connection to fail.
    i  AUTH_KEYNr*   r+   r   r   r9   r9   V   s     DGr   r9   c                       e Zd ZdZdZdZy)
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<   r<   _   s     DGr   r<   c                       e Zd ZdZdZdZy)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?   r?   j   s    
 DGr   r?   c                       e Zd ZdZdZdZy)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   rB   rB   t   s     DGr   rB   N)tlr   InvokeAfterMsgRequestInvokeAfterMsgsRequestInitConnectionRequestInvokeWithLayerRequestInvokeWithoutUpdatesRequestInvokeWithMessagesRangeRequestInvokeWithTakeoutRequestr   	Exceptionr   r(   r-   r0   r3   r6   r9   r<   r?   rB   
BotTimeoutr
   base_errors)xs   0r   <module>rP      s    ##$$##$$)),,&&Cy C: X  h  X H 8  ( H  
 O%6<[-# Qqvvqy  s   C+