+
    i              	          ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t^ RI
Ht ]! ]4      P                  4       P                  ^,          t]R,          R,          t]R,          R,          t]! ]P$                  P'                  R]! ]P*                  ! 4       R,          R,          4      4      4      t]R	,          R
,          tR tRR ltR tR tR tR tR tR tR t R t!R t"R t#R t$R t%R t&]'R8X  d   ](! ]&! 4       4      hR# )    N)Pathdatazfood_log.csvztelegram_offset.txtHEALTH_INPUT_BOT_TOKEN_PATHz.credentialshealth_input_bot_telegram_tokenscriptszprocess_text.pyc                  t    \         P                  R R7      P                  4       p V '       g   \        R4      hV # )utf-8encodingzTelegram token file is empty)
TOKEN_PATH	read_textstripRuntimeError)tokens    scripts/telegram_bot.py
read_tokenr      s2      ' 288:E9::L    c                    T;'       g    / pR V  RV 2p\         P                  P                  V4      P                  R4      p\         P                  P                  WER7      p\         P                  P                  WcR7      ;_uu_ 4       p\        P                  ! VP                  4       P                  R4      4      pRRR4       XP                  R4      '       g   \        RV 24      hVR,          #   + '       g   i     L>; i)	zhttps://api.telegram.org/bot/r	   )r   timeoutNokzTelegram API error: result)urllibparse	urlencodeencoderequestRequesturlopenjsonloadsreaddecodegetr   )	r   methodparamsr   urlr   reqresppayloads	   &&&&     r   api_callr,   !   s    \\rF(q
9C<<!!&)009D
..
 
 
 
0C					5	5**TYY[//89 
6;;t1';<<8	 
6	5s   4C55D	c                       \        \        P                  R R7      P                  4       4      #   \         d     R# i ; i)r	   r
   N)intOFFSET_PATHr   r   	Exception r   r   load_offsetr2   -   s;    ;(('(:@@BCC s   ,/ >>c                     \         P                  P                  R R R7       \         P                  \	        V 4      RR7       R# )T)parentsexist_okr	   r
   N)r/   parentmkdir
write_textstr)offsets   &r   save_offsetr;   4   s2    TD93v;9r   c                 ~    R ^R\         P                  ! R.RR7      /p\        4       pVe   W!R&   \        V RV^#R7      # )r   allowed_updatesmessageF)ensure_asciir:   
getUpdates)r'   r   )r!   dumpsr2   r,   )r   r'   r:   s   &  r   get_updatesrB   9   sH    24::ykFF ]F!xE<CCr   c           
      ,    \        V R RVRVRR/^R7      # )sendMessagechat_idtextdisable_web_page_previewTr   )r,   )r   rE   rF   s   &&&r   send_messagerH   D   s,    E=7"D+ 	 r   c                      \         P                  4       '       g   . # \         P                  R RRR7      ;_uu_ 4       p \        P                  ! V 4      p\        V4      uuRRR4       #   + '       g   i     R# ; i)rr	    )r   newlineN)CSV_PATHexistsopencsv
DictReaderlist)freaders     r   read_csv_rowsrU   L   sO    ??		sWb	9	9Q"F| 
:	9	9	9s   !A))A:	c                      \        V 4      pVP                  4       '       d   \        \        V4      4      # VR  P	                  R4      P	                  R4      #   \
         d    \        T 4      u # i ; i)z.1f0.)float
is_integerr9   r.   rstripr0   )valuens   & r   fmt_numr^   T   sb    %L<<>>s1v;C  %,,S11 5zs   4A !A A21A2c                 b    V R 8X  d   R# V R8X  d   R# V R8X  d   R# V R8X  d   R# T ;'       g    R# )	openclaw_agentOpenClawdeterministic_fallbackFallbackopenaiOpenAIai_agentAIu   לא ידועr1   )srcs   &r   source_labelri   ^   s=    

&&
h
j!!/!r   c                 Z   V '       g   R # R .p\        V 4      ^8X  Ed   V ^ ,          pVP                  RR4      p\        VP                  RR4      4      pVP                  RR4      p\        VP                  RR4      4      p\        VP                  RR4      4      p\        VP                  RR4      4      p\        VP                  R	R4      4      p	VP	                  V R
V V 24       VP	                  V RV RV R24       VP	                  RV	 24       RP                  V4      # Rp
RpRp. p\        V ^R7       EFa  w  rVP                  RR4      p\        VP                  RR4      4      pVP                  RR4      p\        VP                  RR4      4      p\        VP                  RR4      4      p\        VP                  RR4      4      pVP	                  VP                  R	R4      4        T
\        VP                  R^ 4      ;'       g    ^ 4      ,          p
T\        VP                  R^ 4      ;'       g    ^ 4      ,          pT\        VP                  R^ 4      ;'       g    ^ 4      ,          pVP	                  V RV R
V V R
V RV RV R24       EKd  	  \        V'       d
   V^ ,          MR4      pVP	                  R\        V
4       R\        V4       R\        V4       R24       VP	                  RV 24       RP                  V4      #   \         d     Li ; i)u   נרשם ✅	food_namerK   quantityunitcaloriesrW   	protein_gfat_gparser_sourcez - u    קלוריות | u   g חלבון | u
   g שומןu
   מקור: 
g        )startz. u
    קל׳ | u
   סה״כ: )	lenr%   r^   ri   appendjoin	enumeraterY   r0   )new_rowslinesrJ   foodqtyrm   calproteinfatrh   	total_caltotal_protein	total_fat
src_valuesisources   &               r   build_success_replyr   j   s   E
8}QKuu["%aeeJ+,uuVR aeeJ,-!%%S12aeeGS)*155"56vSdV,-u.wise:VWz#'(yyIMIJ(!,,uu["%aeeJ+,uuVR aeeJ,-!%%S12aeeGS)*!%%45	quuZ388q99IU155a#8#=#=A>>MquuWa055A66I 	s"TF#cU4&C5
7)?[^Z__ijk! -$ :*Q-2>F	LL:gi01GM<R;SSbcjktcubv  wA  B  C	LL:fX&'99U  		s   7A
L+L.LL*)L*c           	         \        4       p\        V4      p\        P                  P	                  4       p\
        P                  ! \        P                  \        \        4      V .\        \        4      VR R ^ZR7      p\        4       pWRR pVP                  VP                  P                  4       VP                  P                  4       V3# )T)cwdenvcapture_outputrF   r   N)rU   rt   osenvironcopy
subprocessrunsys
executabler9   PROCESS_TEXTBASE_DIR
returncodestdoutr   stderr)raw_textbefore_rowsbefore_countr   proc
after_rowsrx   s   &      r   run_process_textr      s    /K{#L
**//
C>>	\*H5MD J-(H??DKK--/1B1B1DhNNr   c           
         VP                  R 4      pVP                  R4      ;'       g    / pVP                  R4      ;'       g    / pVP                  R4      pVP                  R4      ;'       g    RP                  4       pV'       g   R#  V'       d	   V'       g    \        \        V4      ^,           4       R# \	        V4      w  rxrV^ 8X  d   \        V
4      pMRp\        WV4       \        RV R	V R
\        V
4       2RR7       V'       d   \        RVR,           2RR7       V	'       d   \        RV	R,           2RR7       \        \        V4      ^,           4       R#   \        \        T4      ^,           4       i ; i)	update_idr>   chatidrF   rK   Nu.   לא הצלחתי לרשום את הדיווחzprocessed update_id=z rc=z rows=Tflushzprocess_stdout=:Ni,  Nzprocess_stderr=)	r%   r   r;   r.   r   r   rH   printrt   )r   updater   msgr   rE   rF   rcr   r   rx   replys   &&          r   handle_updater      s5   

;'I
**Y

%
%2C776?  bDhhtnGGGFO!!r((*D(d$ 	C	NQ&'! (8'=$F7'1EDEUU+$YKtB4vc(m_MUYZOF4L>2$?OF4L>2$? 	C	NQ&'C	NQ&'s   E$ E$ ;A4E$ 0E$ $Fc                      \        4       p \        V 4      pV F  p\        W4       K  	  \        R \	        V4       2RR7       ^ # )zprocessed_updates=Tr   )r   rB   r   r   rt   )r   updatesr   s      r   run_oncer      s>    LE% Ge$ 	s7|n
-T:r   c                     \        R RR7         \        4        \        P
                  ! ^4       K$    \         d    \        RRR7        ^ # \         d1   p \        RT  2RR7       \        P
                  ! ^4        Rp ? LhRp ? ii ; i)z Rev002 Telegram bot loop startedTr   stoppedzloop_error=N)r   r   KeyboardInterruptr0   timesleep)es    r   run_loopr      sl    	
,D9
	J 	

1 ! 	)4( 	Ks#40JJqMM	s!   
2 BBB&BBc                      \         P                  ! 4       p V P                  R RR7       V P                  4       pVP                  '       d   \        4       # \        4       # )z--loop
store_true)action)argparseArgumentParseradd_argument
parse_argsloopr   r   )parserargss     r   mainr      sJ    $$&F
6Dyyyz:r   __main__)N(   ))r   rP   r!   r   r   r   r   urllib.parser   urllib.requestpathlibr   __file__resolver4   r   rM   r/   r   r%   r9   homer   r   r   r,   r2   r;   rB   rH   rU   r^   ri   r   r   r   r   r   r   __name__
SystemExitr1   r   r   <module>r      s    
  	  
    >!!#++A.f~-"77"**..!		n$'HHI 

 )#&77	:
D	"/dO*(B z
TV
 r   