portable token
This commit is contained in:
		
							parent
							
								
									586668c7e0
								
							
						
					
					
						commit
						0d39e0e01d
					
				
							
								
								
									
										6
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								main.py
									
									
									
									
									
								
							| @ -1,4 +1,5 @@ | ||||
| import logging | ||||
| import os | ||||
| 
 | ||||
| from telegram import InlineKeyboardMarkup | ||||
| from telegram.ext import Updater, CallbackQueryHandler, MessageHandler, Filters | ||||
| @ -40,8 +41,11 @@ def download_choosen_format(update, context): | ||||
|     context.bot.delete_message(chat_id=query.message.chat_id, | ||||
|                                message_id=query.message.message_id) | ||||
| 
 | ||||
| TOKEN = None | ||||
| with open('bot.token') as f: | ||||
|     TOKEN = f.read().strip() | ||||
| 
 | ||||
| updater = Updater(token="") | ||||
| updater = Updater(token=TOKEN) | ||||
| 
 | ||||
| updater.dispatcher.add_handler(MessageHandler(Filters.text, get_format)) | ||||
| updater.dispatcher.add_handler(CallbackQueryHandler(download_choosen_format)) | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user