From 55f517d5bf549c19106cc9b0cfa20a84204ff775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sat, 3 Feb 2018 19:14:34 +0100 Subject: [PATCH] fix empty message error --- robot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/robot.py b/robot.py index 27ddbaf..3c522bf 100755 --- a/robot.py +++ b/robot.py @@ -139,9 +139,14 @@ def handle_rest(bot, update): url = bot.getFile(file).file_path logger.info("Downloading %s" % url) hashtag = get_first_hashtag(update.message) + reply = 'Downloading' + if hashtag: + mkdir_p(f'{OUT_DIR}/{hashtag}') + reply += f' to "{hashtag}"' + reply += '...' + update.message.reply_text(reply) if hashtag: mkdir_p(f'{OUT_DIR}/{hashtag}') - update.message.reply_text('Downloading%s...' % f' to "{hashtag}"' if hashtag else '') download_raw(url, hashtag or '.', update.message.date) except: type, value, _ = sys.exc_info()