From 9fe9c815867be2f450169a5a5d0cb0c1b593e57e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Thu, 25 Jul 2019 11:05:52 +0200 Subject: [PATCH] prevent unnecessary "file too big" errors (?) --- delojza.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/delojza.py b/delojza.py index 620c9e7..a30e105 100755 --- a/delojza.py +++ b/delojza.py @@ -445,13 +445,15 @@ class DelojzaBot: return ytdl_res or raw_res def tg_handle(self, bot, update): - url_res = self.handle_urls(update.message, self._get_hashtags(update.message)) - if url_res: - return + hashtags = self._get_hashtags(update.message) + if hashtags: + url_res = self.handle_urls(update.message, self._get_hashtags(update.message)) + if url_res: + return - msg_res = self.handle_tg_message(update.message, bot, self._get_hashtags(update.message)) - if msg_res: - return + msg_res = self.handle_tg_message(update.message, bot, self._get_hashtags(update.message)) + if msg_res: + return hashtags = self.extract_hashtags(update.message) if len(hashtags) > 0: