
    dh                        d dl mZmZ d dlmZ d dlmZ d dlm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 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+),    )AnyOptional)TelegramMethod)TelegramType)docs_urlc                       e Zd ZdZy)AiogramErrorz0
    Base exception for all aiogram errors.
    N__name__
__module____qualname____doc__     L/var/www/netwell/bot/venv/lib/python3.12/site-packages/aiogram/exceptions.pyr	   r	          r   r	   c                   N    e Zd ZU dZdZee   ed<   deddfdZdefdZ	defdZ
y)	DetailedAiogramErrorzF
    Base exception for all aiogram errors with detailed message.
    Nurlmessagereturnc                     || _         y Nr   selfr   s     r   __init__zDetailedAiogramError.__init__   s	    r   c                 \    | j                   }| j                  r|d| j                   dz  }|S )Nz
(background on this error at: ))r   r   r   s     r   __str__zDetailedAiogramError.__str__   s/    ,,889$((1EEGr   c                 8    t        |       j                   d|  dS )Nz('z'))typer   )r   s    r   __repr__zDetailedAiogramError.__repr__   s     t*%%&bb11r   )r   r   r   r   r   r   str__annotations__r   r    r#   r   r   r   r   r      sB     C#   2# 2r   r   c                       e Zd ZdZy)CallbackAnswerExceptionz(
    Exception for callback answer.
    Nr
   r   r   r   r'   r'   "   r   r   r'   c                       e Zd ZdZy)SceneExceptionz
    Exception for scenes.
    Nr
   r   r   r   r)   r)   (   r   r   r)   c                   $    e Zd ZdZ edd      Zy)UnsupportedKeywordArgumentzG
    Exception raised when a keyword argument is passed as filter.
    zmigration_2_to_3.htmlzfiltering-events)	fragment_N)r   r   r   r   r   r   r   r   r   r+   r+   .   s     *6H
ICr   r+   c                   V     e Zd ZU dZdZeed<   dee   deddf fdZ	def fd	Z
 xZS )
TelegramAPIErrorz5
    Base exception for all Telegram API errors.
    zTelegram server sayslabelmethodr   r   Nc                 4    t         |   |       || _        y )Nr   )superr   r0   )r   r0   r   	__class__s      r   r   zTelegramAPIError.__init__=   s    
 	)r   c                 B    t         |          }| j                   d| S )Nz - )r2   r    r/   )r   original_messager3   s     r   r    zTelegramAPIError.__str__E   s'     7?,**S!1 233r   )r   r   r   r   r/   r$   r%   r   r   r   r    __classcell__r3   s   @r   r.   r.   6   sK     (E3'|,  
	4 4 4r   r.   c                       e Zd ZdZdZy)TelegramNetworkErrorz9
    Base exception for all Telegram network errors.
    zHTTP Client saysN)r   r   r   r   r/   r   r   r   r9   r9   J   s     Er   r9   c                   >     e Zd ZdZdZdee   dededdf fdZ	 xZ
S )	TelegramRetryAfterz6
    Exception raised when flood control exceeds.
    zOhttps://core.telegram.org/bots/faq#my-bot-is-hitting-limits-how-do-i-avoid-thisr0   r   retry_afterr   Nc                     dt        |      j                  }t        |dd       x}r|d| z  }|d| dz  }|d| z  }t        |   ||       || _        y )Nz!Flood control exceeded on method chat_idz	 in chat z. Retry in z	 seconds.
Original description: r0   r   )r"   r   getattrr2   r   r<   )r   r0   r   r<   descriptionr>   r3   s         r   r   zTelegramRetryAfter.__init__Y   s     :$v,:O:O9RSfi6676Ywi00K[M;;1';;<&r   r   r   r   r   r   r   r   r$   intr   r6   r7   s   @r   r;   r;   R   sE     \C'|,' ' 	'
 
' 'r   r;   c                   >     e Zd ZdZdZdee   dededdf fdZ	 xZ
S )	TelegramMigrateToChatzG
    Exception raised when chat has been migrated to a supergroup.
    z5https://core.telegram.org/bots/api#responseparametersr0   r   migrate_to_chat_idr   Nc                 ~    d| }t        |dd       x}r|d| z  }|d| z  }t        | 	  ||       || _        y )Nz4The group has been migrated to a supergroup with id r>   z from r?   r@   )rA   r2   r   rG   )r   r0   r   rG   rB   r>   r3   s         r   r   zTelegramMigrateToChat.__init__p   se     MM_L`afi6676VG9--K1';;<"4r   rC   r7   s   @r   rF   rF   i   sE     BC5|,5 5  	5
 
5 5r   rF   c                       e Zd ZdZy)TelegramBadRequestz5
    Exception raised when request is malformed.
    Nr
   r   r   r   rJ   rJ   ~   r   r   rJ   c                       e Zd ZdZy)TelegramNotFoundzD
    Exception raised when chat, message, user, etc. not found.
    Nr
   r   r   r   rL   rL      r   r   rL   c                       e Zd ZdZy)TelegramConflictErrorza
    Exception raised when bot token is already used by another application in polling mode.
    Nr
   r   r   r   rN   rN      r   r   rN   c                       e Zd ZdZy)TelegramUnauthorizedErrorz5
    Exception raised when bot token is invalid.
    Nr
   r   r   r   rP   rP      r   r   rP   c                       e Zd ZdZy)TelegramForbiddenErrorz?
    Exception raised when bot is kicked from chat or etc.
    Nr
   r   r   r   rR   rR      r   r   rR   c                       e Zd ZdZy)TelegramServerErrorzB
    Exception raised when Telegram server returns 5xx error.
    Nr
   r   r   r   rT   rT      r   r   rT   c                       e Zd ZdZy)RestartingTelegrama/  
    Exception raised when Telegram server is restarting.

    It seems like this error is not used by Telegram anymore,
    but it's still here for backward compatibility.

    Currently, you should expect that Telegram can raise RetryAfter (with timeout 5 seconds)
     error instead of this one.
    Nr
   r   r   r   rV   rV      s    r   rV   c                       e Zd ZdZdZy)TelegramEntityTooLargezP
    Exception raised when you are trying to send a file that is too large.
    z0https://core.telegram.org/bots/api#sending-filesN)r   r   r   r   r   r   r   r   rX   rX      s     =Cr   rX   c                   4    e Zd ZdZdedededdfdZdefdZy)	ClientDecodeErrorzX
    Exception raised when client can't decode response. (Malformed response, etc.)
    r   originaldatar   Nc                 .    || _         || _        || _        y r   )r   r[   r\   )r   r   r[   r\   s       r   r   zClientDecodeError.__init__   s     	r   c           	          t        | j                        }| j                   d|j                   d|j                   d| j                   d| j
                   	S )Nz
Caused from error: .z: z

Content: )r"   r[   r   r   r   r\   )r   original_types     r   r    zClientDecodeError.__str__   sZ    T]]+||n "''(-*@*@)ADMM? S		{$	
r   )	r   r   r   r   r$   	Exceptionr   r   r    r   r   r   rZ   rZ      s4     y   

 
r   rZ   c                       e Zd ZdZy)DataNotDictLikeErrorz6
    Exception raised when data is not dict-like.
    Nr
   r   r   r   rc   rc      r   r   rc   N)typingr   r   aiogram.methodsr   aiogram.methods.baser   aiogram.utils.linkr   ra   r	   r   r'   r)   r+   r.   r9   r;   rF   rJ   rL   rN   rP   rR   rT   rV   rX   rZ   rc   r   r   r   <module>rh      s     * - '9 2< 2(l \ J!5 J4+ 4(+ ') '.5, 5*) ' ,  0 - * 	, 	=1 =
 
(/ r   