fix empty message error
This commit is contained in:
parent
01ad1aad8f
commit
55f517d5bf
1 changed files with 6 additions and 1 deletions
7
robot.py
7
robot.py
|
@ -139,9 +139,14 @@ def handle_rest(bot, update):
|
||||||
url = bot.getFile(file).file_path
|
url = bot.getFile(file).file_path
|
||||||
logger.info("Downloading %s" % url)
|
logger.info("Downloading %s" % url)
|
||||||
hashtag = get_first_hashtag(update.message)
|
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:
|
if hashtag:
|
||||||
mkdir_p(f'{OUT_DIR}/{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)
|
download_raw(url, hashtag or '.', update.message.date)
|
||||||
except:
|
except:
|
||||||
type, value, _ = sys.exc_info()
|
type, value, _ = sys.exc_info()
|
||||||
|
|
Loading…
Reference in a new issue