From e580d06170607f0bc613d15d65d784193a5a0102 Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sun, 9 Mar 2025 15:03:14 +0300 Subject: [PATCH] Add 'no_image' flag for posts without media --- post_parser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/post_parser.py b/post_parser.py index 2fe3a2f..9c4be20 100644 --- a/post_parser.py +++ b/post_parser.py @@ -209,6 +209,10 @@ class PostParser: # Add flag "video" if the message media is VIDEO and the body text is up to 100 characters. if message.media == MessageMediaType.VIDEO and len(message_text.strip()) <= 100: flags.append("video") + + # Add flag for posts without images + if not message.media or message.media == MessageMediaType.POLL: + flags.append("no_image") # Check if the message text contains variations of the word "стрим", "вебинар" # or "онлайн-лекция" in a case-insensitive manner.