Ignore by default, only dl w/ hashtag

feature-unify_handlers
Tomáš Mládek 2018-09-02 19:55:18 +02:00 committed by Tomáš Mládek
parent 49c800ab39
commit 4f7c84c54c
1 changed files with 4 additions and 4 deletions

View File

@ -119,13 +119,13 @@ def handle_hashtag(bot, update):
# noinspection PyBroadException
def handle(urls, message, download, filename=None):
try:
logger.info("Downloading %s" % urls)
hashtag = get_first_hashtag(message)
if hashtag == 'IGNORE':
message.reply_text('Ignoring...')
if hashtag is None:
logger.info("Ignoring %s due to no hashtag present..." % urls)
return
logger.info("Downloading %s" % urls)
reply = 'Downloading'
if hashtag:
mkdir_p(f'{OUT_DIR}/{hashtag}')