File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11"""Simple Telegram Bot which parse .xlsx file by user message pattern""" 
22
33import  os 
4+ import  sys 
45import  logging 
56from  telegram  import  Update 
67from  telegram .ext  import  ApplicationBuilder , CommandHandler , ContextTypes 
910TELEGRAM_BOT_TOKEN  =  os .getenv ("TELEGRAM_BOT_TOKEN" )
1011XLSX_FILE_PATH  =  os .getenv ("XLSX_FILE_PATH" )
1112
13+ logging .basicConfig (level = logging .INFO , format = '%(asctime)s - %(levelname)s - %(message)s' , stream = sys .stdout )
14+ 
1215async  def  find (update : Update , context : ContextTypes .DEFAULT_TYPE ) ->  None :
1316    """Function which parse excel file by user message and send response to Telegram Bot""" 
1417    if  update .message  and  update .message .text :
@@ -40,8 +43,6 @@ async def find(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
4043        if  response_message  ==  '' :
4144            response_message  +=  "Not Found" 
4245
43-         logging .info ("Successfull send message to Telegram Bot!" )
44- 
4546        await  update .message .reply_text (f"{ response_message }  " )
4647
4748def  get_headers (sheet : any  ) ->  dict :
@@ -63,4 +64,3 @@ def main():
6364
6465if  __name__  ==  "__main__" :
6566    main ()
66-     
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments