diff --git a/aiogram/api/client/bot.py b/aiogram/api/client/bot.py index 5a78e589..ce12de07 100644 --- a/aiogram/api/client/bot.py +++ b/aiogram/api/client/bot.py @@ -1214,7 +1214,7 @@ class Bot(ContextInstanceMixin["Bot"]): allows_multiple_answers: Optional[bool] = None, correct_option_id: Optional[int] = None, explanation: Optional[str] = None, - explanation_parse_mode: Optional[str] = None, + explanation_parse_mode: Optional[str] = UNSET, open_period: Optional[int] = None, close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, is_closed: Optional[bool] = None, diff --git a/aiogram/api/methods/base.py b/aiogram/api/methods/base.py index 1ad41445..dfdfda34 100644 --- a/aiogram/api/methods/base.py +++ b/aiogram/api/methods/base.py @@ -56,8 +56,9 @@ class TelegramMethod(abc.ABC, BaseModel, Generic[T]): a model initialization from `Bot.method_name`, so we must take care of it and remove it before fields validation. """ - if "parse_mode" in values and values["parse_mode"] is UNSET: - values.pop("parse_mode") + for parse_mode_attribute in {"parse_mode", "explanation_parse_mode"}: + if parse_mode_attribute in values and values[parse_mode_attribute] is UNSET: + values.pop(parse_mode_attribute) return values @property diff --git a/aiogram/api/methods/send_poll.py b/aiogram/api/methods/send_poll.py index 0868d0b2..b716a9c8 100644 --- a/aiogram/api/methods/send_poll.py +++ b/aiogram/api/methods/send_poll.py @@ -9,6 +9,7 @@ from ..types import ( Message, ReplyKeyboardMarkup, ReplyKeyboardRemove, + UNSET, ) from .base import Request, TelegramMethod, prepare_parse_mode @@ -44,7 +45,7 @@ class SendPoll(TelegramMethod[Message]): explanation: Optional[str] = None """Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing""" - explanation_parse_mode: Optional[str] = None + explanation_parse_mode: Optional[str] = UNSET """Mode for parsing entities in the explanation. See formatting options for more details.""" open_period: Optional[int] = None """Amount of time in seconds the poll will be active after creation, 5-600. Can't be used