
    N[i
                         d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlmZmZ  e j                  e
      Z G d d      Zy)    N)raw)types)UserMigrate)SessionAuthc                        e Zd ZdddeddfdZy)	SignInBotselfzpyrogram.Client	bot_tokenreturnz
types.Userc           
        K   	 	 | j                  t        j                  j                  j	                  d| j
                  | j                  |             d{   }| j                  j                  |j                  j                         d{    | j                  j                  d       d{    t        j                  j                  | |j                        S 7 7 S7 2# t        $ r|}| j                   j#                          d{  7   | j                  j%                  |j&                         d{  7   | j                  j)                  t+        | | j                  j%                          d{  7  | j                  j-                          d{  7        j/                          d{  7         d{  7   t1        | | j                  j%                          d{  7  | j                  j)                          d{  7  | j                  j-                          d{  7        | _        | j                   j3                          d{  7   Y d}~nd}~ww xY wnw)a  Authorize a bot using its bot token generated by BotFather.

        .. include:: /_includes/usable-by/bots.rst

        Parameters:
            bot_token (``str``):
                The bot token generated by BotFather

        Returns:
            :obj:`~pyrogram.types.User`: On success, the bot identity is return in form of a user object.

        Raises:
            BadRequest: In case the bot token is invalid.
        Tr   )flagsapi_idapi_hashbot_auth_tokenN)invoker   	functionsauthImportBotAuthorizationr   r   storageuser_iduseridis_botr   User_parser   sessionstopdc_idvalueauth_keyr   	test_modecreater   start)r
   r   res       T/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/auth/sign_in_bot.pysign_in_botzSignInBot.sign_in_bot   s    $ 7++MM&&==#{{!%'0	 >  2 ll**16699555ll))$///zz((qvv6692 6/%  +ll'')))ll((111ll++DLL$6$6$888"ll44666 fh     ' 2 2 444,,//1119O9O9Q3Q3Q 
 ll((***+ s   I2AC' C!C' 2I2C#"I22C%3.I2!C' #I2%I2'
I-1I(D-I(<D?==I(:E=;!I(FI(7F:
8I(G(I(-G0.!I(H!I(1H42+I(I I(#I2(I--I2N)__name__
__module____qualname__strr(        r'   r	   r	      s!    070707 
07r.   r	   )loggingpyrogramr   r   pyrogram.errorsr   pyrogram.sessionr   r   	getLoggerr)   logr	   r-   r.   r'   <module>r5      s5   &     ' *g!17 17r.   