fix empty message error

This commit is contained in:
Tomáš Mládek 2018-02-03 19:14:34 +01:00 committed by Tomááas Mladek
parent 01ad1aad8f
commit 55f517d5bf

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