From ad28329a3e0bab87ce94126d849a9e8ed4874691 Mon Sep 17 00:00:00 2001 From: Hodza Alban Date: Thu, 10 Aug 2017 09:26:54 +0200 Subject: [PATCH] improve UX speed --- main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 4e8e49a..66c11f6 100644 --- a/main.py +++ b/main.py @@ -22,12 +22,11 @@ def get_format(bot, update): def download_choosen_format(bot, update): query = update.callback_query - - video.download(query.data) bot.edit_message_text(text="Downloading...", chat_id=query.message.chat_id, message_id=query.message.message_id) - + video.download(query.data) + with video.send() as files: for f in files: bot.send_document(chat_id=query.message.chat_id, document=open(f, 'rb'))