From 6fd4285b3b2e57ee8634e78d0deafa0936d25e5d Mon Sep 17 00:00:00 2001 From: Hodza Alban Date: Sat, 19 Aug 2017 17:34:53 +0200 Subject: [PATCH] removed bug (and added too) --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 0287311..e9eb9c2 100644 --- a/main.py +++ b/main.py @@ -20,8 +20,14 @@ def get_format(bot, update): except BadLink: update.message.reply_text("Bad link") else: + for i, v in enumerate(VIDEOS): + if v.chat_id == video.chat_id: + VIDEOS[i] = video # remove old video not downloaded... + break + else: + VIDEOS.append(video) + reply_markup = InlineKeyboardMarkup(video.keyboard) - VIDEOS.append(video) update.message.reply_text('Choose format:', reply_markup=reply_markup)