Browse Source

portable token

thezero 5 months ago
parent
commit
0d39e0e01d
1 changed files with 5 additions and 1 deletions
  1. 5 1
      main.py

+ 5 - 1
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))