Added __name__=__main__ for easier startup
Also made replies silent
This commit is contained in:
		
							parent
							
								
									3510c87e4d
								
							
						
					
					
						commit
						bb1a7ce99a
					
				
					 1 changed files with 13 additions and 8 deletions
				
			
		
							
								
								
									
										21
									
								
								bot.py
									
										
									
									
									
								
							
							
						
						
									
										21
									
								
								bot.py
									
										
									
									
									
								
							|  | @ -96,7 +96,7 @@ def handle_vvs(update, context): | |||
|     departures = get_vvs_departures(query) | ||||
| 
 | ||||
|     for reply in departures: | ||||
|         update.message.reply_text(reply) | ||||
|         update.message.reply_text(reply, disable_notification=True) | ||||
| 
 | ||||
| 
 | ||||
| def parse_station(args): | ||||
|  | @ -168,12 +168,17 @@ def error_callback(update, context): | |||
|         return | ||||
| 
 | ||||
| 
 | ||||
| inline_station_search_handler = InlineQueryHandler(inline_station_search) | ||||
| def __main__(): | ||||
|     inline_station_search_handler = InlineQueryHandler(inline_station_search) | ||||
|     dispatcher.add_handler(inline_station_search_handler) | ||||
|     dispatcher.add_handler(CommandHandler('vvs', handle_vvs)) | ||||
| 
 | ||||
| dispatcher.add_handler(inline_station_search_handler) | ||||
| dispatcher.add_handler(CommandHandler('vvs', handle_vvs)) | ||||
| dispatcher.add_error_handler(error_callback) | ||||
| dispatcher.add_handler(CallbackQueryHandler(handle_multiple_stations_reply)) | ||||
|     dispatcher.add_error_handler(error_callback) | ||||
| 
 | ||||
| updater.start_polling() | ||||
| updater.idle() | ||||
|     dispatcher.add_handler(CallbackQueryHandler(handle_multiple_stations_reply)) | ||||
|     updater.start_polling() | ||||
|     updater.idle() | ||||
| 
 | ||||
| 
 | ||||
| if __name__ == "__main__": | ||||
|     __main__() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue