don't ignore protected tags completely, download to PUBLIC/ instead

feature-unify_handlers
Tomáš Mládek 2019-05-22 12:12:16 +02:00
parent 4d74e08b00
commit 4059ce6366
1 changed files with 2 additions and 7 deletions

View File

@ -12,7 +12,6 @@ from configparser import ConfigParser
from datetime import datetime, timedelta from datetime import datetime, timedelta
from glob import glob from glob import glob
from operator import itemgetter from operator import itemgetter
from random import choice
import acoustid import acoustid
import filetype import filetype
@ -264,13 +263,9 @@ class DelojzaBot:
if any(hashtag in self.protected_tags for hashtag in hashtags): if any(hashtag in self.protected_tags for hashtag in hashtags):
if message.chat.title not in self.protected_chats: 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)) .format(urls, message.chat.title, hashtags))
replies = ["Nein", "Nope", ":(", "Error: Cannot.", hashtags.insert(0, "PUBLIC")
"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
self.last_hashtags = None self.last_hashtags = None