fix last hashtag detection

This commit is contained in:
Tomáš Mládek 2019-05-19 11:11:27 +02:00
parent 186450d1c7
commit 48bb352d11

View file

@ -240,9 +240,9 @@ class DelojzaBot:
def get_hashtags(self, message): def get_hashtags(self, message):
hashtags = self.extract_hashtags(message) hashtags = self.extract_hashtags(message)
if len(hashtags) == 0 and self.last_hashtags is not None: if len(hashtags) == 0 and self.last_hashtags is not None:
user, chat, ts, hashtags = self.last_hashtags user, chat, ts, last_hashtags = self.last_hashtags
if user == message.from_user and chat == message.chat and ts > datetime.now() - timedelta(hours=1): if user == message.from_user and chat == message.chat and ts > datetime.now() - timedelta(hours=1):
hashtags = self.last_hashtags[1] hashtags = last_hashtags
return hashtags return hashtags
def tg_handle_hashtag(self, bot, update): def tg_handle_hashtag(self, bot, update):