From ac3bbbdff920ded3875d017a0380d212d27f8548 Mon Sep 17 00:00:00 2001 From: Ilya Nikolaev <65247719+ilya-nikolaev@users.noreply.github.com> Date: Tue, 21 May 2024 19:30:07 +0300 Subject: [PATCH] Added check for question_parse_mode --- src/sulguk/aiogram_middleware.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sulguk/aiogram_middleware.py b/src/sulguk/aiogram_middleware.py index f5447f1..c16eb55 100644 --- a/src/sulguk/aiogram_middleware.py +++ b/src/sulguk/aiogram_middleware.py @@ -126,6 +126,10 @@ def _transform_poll(self, method: SendPoll, bot: Bot): method.explanation_entities = explanation_result.entities method.explanation_parse_mode = None + if not self._is_parse_mode_supported( + method, bot, "question_parse_mode"): + return + question_result = transform_html(method.question) method.question = question_result.text method.question_entities = question_result.entities