fix empty message error

This commit is contained in:
Tomááas Mladek 2018-02-03 19:14:34 +01:00
parent fe292a4fa9
commit a93863fa33

View file

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