From 0d39e0e01d3bd0f97b3e0f5625b89bb8bc865701 Mon Sep 17 00:00:00 2001 From: thezero Date: Sat, 19 Jun 2021 20:40:49 +0200 Subject: [PATCH] portable token --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index cba7f2b..cf650b1 100644 --- a/main.py +++ b/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))