diff --git a/src/vk_parser_app/workers/tg_poster.py b/src/vk_parser_app/workers/tg_poster.py index 82bc008..34b33ba 100644 --- a/src/vk_parser_app/workers/tg_poster.py +++ b/src/vk_parser_app/workers/tg_poster.py @@ -373,6 +373,9 @@ class TelegramPoster: return "\n".join(paragraphs) def build_rich_message(self, text: str, media_rows: list[dict[str, Any]]) -> dict[str, Any] | None: + if len(media_rows) > MAX_RICH_MEDIA: + return None + rich_media = [] media_tags = [] for idx, item in enumerate(media_rows[:MAX_RICH_MEDIA]):