
    quj	                        S r SSKJr  SSKJr  SSKJrJrJrJ	r	J
r
  SSKJr  SrS/r\R                  " S	5      (       a?  \R                  " S	5      R!                  5        H  r \R%                  \" \5      5        M     S r\	" SS9S 5       r\R                  " S5      (       a#  \R0                  " \\R2                  " S\S95        gg! \ a    \R*                  " S
\ 35         M  f = f)u]  
Fasly Bot Cheat.

• `{i}fastly` - On/Off command. 

• Also Required : `OCR_API`. Add it using the command `.setdb OCR_API api_key`
• To get the API visit 'https://ocr.space/ocrapi'
The bot will try to auto reply first to the messages by @FastlyWriteBot

• Add User id of fastly clone to `FASTLY_CLONES` to allow this plugin work with them.
    )upload_file)events   )udBLOGSultroid_botultroid_cmdasync_searcher)removez>https://api.ocr.space/parse/imageurl?apikey={api}&url={tgraph}i6kFASTLY_CLONESz"Invalid Value in 'FASTLY_CLONES': c                   #    [         R                  " S5      (       d  g [         R                  " S5      nU(       a  U R                  (       d  g U R                  5       I S h  vN n[	        U5      nSUS   -   n[        [        R                  XS9SS9I S h  vN n US   S   S	   nUR                  S
5      S   R                  SS5      R                  SS5      nU(       a   U R                  U5      I S h  vN    [!        U5        g  N Nt! [        [        4 a     g f = f N+! [         a   n[        R                  " U5         S nANNS nAff = f! [         a   n[        R                  " U5         S nAg S nAff = f7f)NFASTLYOCR_APIzhttps://telegra.phr   )apitgraphT)re_jsonParsedResults
ParsedTextzBy@
 )r   get_keyphotodownload_mediar   r
   base_urlformatKeyError
IndexErrorsplitreplacereply	Exceptionr   	exceptionr   )	eventr   meduploadlinkouttxteres	            "/root/TeamUltroid/addons/fastly.py
fastly_botr-   %   sI    ;;x  
++i
 CEKK$$&
&CF&)+Dx3DdS
SC/"1%l3 ))E
1

%
%dB
/
7
7b
AC
	++c"""s ' T j! 
 # 	NN2	  qs   AF !D
"5F DF D (;F $D& 8D$9D& >E 	F F D!F  D!!F $D& &
E0EF EF 
E=E83F 8E==F zfastly$)patternc                   #    U R                  S5      I S h  vN n[        R                  " S5      nU(       d  [        R                  " S5      (       d  UR                  S5      I S h  vN $ [        R                  " SS5        [
        R                  " [        [        R                  " S[        S95        UR                  S5      I S h  vN $ [        R                  " S5        UR                  S5      I S h  vN   g  N N N8 N7f)	Nz`...`r   r   z0`OCR_API` is missing.
Add it before using this..Tincoming
from_usersz `Auto Fastly Response Activated`z`Fastly Stopped!`)eorr   r   editset_keyr   add_handlerr-   r   
NewMessageBotListdel_key)r$   xxget_s      r,   	fastOnOffr<   ?   s     yy!	!B;;x D{{9%%!TUUUHd#t@	
 WW?@@@KK
''%
&&& 
" V A&sG   DC?AD(D)A!D
D.D9D:DDDDr   Tr0   N)__doc__	telegraphr   telethonr   r   r   r   r   r	   r
   osr   r   r8   r   r   iappendint	TypeErrorr#   r-   r<   r6   r7        r,   <module>rG      s   
 "  A A K,;;[[)//1	ENN3q6" 24 Y'  '  ;;x4G< _  	ENN?sCD	Es   #CC'&C'