From 4059ce63668b58704de8c77b5c7d0439d1de6332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Wed, 22 May 2019 12:12:16 +0200 Subject: [PATCH] don't ignore protected tags completely, download to PUBLIC/ instead --- delojza.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/delojza.py b/delojza.py index ba78084..457d328 100755 --- a/delojza.py +++ b/delojza.py @@ -12,7 +12,6 @@ from configparser import ConfigParser from datetime import datetime, timedelta from glob import glob from operator import itemgetter -from random import choice import acoustid import filetype @@ -264,13 +263,9 @@ class DelojzaBot: if any(hashtag in self.protected_tags for hashtag in hashtags): if message.chat.title not in self.protected_chats: - self.logger.info("Ignoring {} in chat {} due to protected hashtags: {}..." + self.logger.info("Redirecting {} in chat {} due to protected hashtags: {}..." .format(urls, message.chat.title, hashtags)) - replies = ["Nein", "Nope", ":(", "Error: Cannot.", - "Error: {}".format(self.markov.make_sentence() if self.markov else "Cannot."), - "Failed: {}".format(self.markov.make_sentence() if self.markov else "Cannot.")] - message.reply_text(choice(replies)) - return + hashtags.insert(0, "PUBLIC") self.last_hashtags = None