portable token

This commit is contained in:
thezero 2021-06-19 20:40:49 +02:00
parent 586668c7e0
commit 0d39e0e01d

View File

@ -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))