From c56da467aded06d26a4c367c99d20a295f0b61ae Mon Sep 17 00:00:00 2001 From: JRoot Junior Date: Sun, 17 Aug 2025 19:03:26 +0300 Subject: [PATCH] Switch `send_date` type from `int` to `DateTime` in suggested post models --- .butcher/types/SuggestedPostApproved/replace.yml | 5 +++++ .butcher/types/SuggestedPostParameters/replace.yml | 5 +++++ aiogram/types/suggested_post_approved.py | 5 +++-- aiogram/types/suggested_post_parameters.py | 5 +++-- 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 .butcher/types/SuggestedPostApproved/replace.yml create mode 100644 .butcher/types/SuggestedPostParameters/replace.yml diff --git a/.butcher/types/SuggestedPostApproved/replace.yml b/.butcher/types/SuggestedPostApproved/replace.yml new file mode 100644 index 00000000..26ef9ec3 --- /dev/null +++ b/.butcher/types/SuggestedPostApproved/replace.yml @@ -0,0 +1,5 @@ +annotations: + send_date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/SuggestedPostParameters/replace.yml b/.butcher/types/SuggestedPostParameters/replace.yml new file mode 100644 index 00000000..26ef9ec3 --- /dev/null +++ b/.butcher/types/SuggestedPostParameters/replace.yml @@ -0,0 +1,5 @@ +annotations: + send_date: + parsed_type: + type: std + name: DateTime diff --git a/aiogram/types/suggested_post_approved.py b/aiogram/types/suggested_post_approved.py index 2eb8afa7..8d582f60 100644 --- a/aiogram/types/suggested_post_approved.py +++ b/aiogram/types/suggested_post_approved.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional from .base import TelegramObject +from .custom import DateTime if TYPE_CHECKING: from .message import Message @@ -16,7 +17,7 @@ class SuggestedPostApproved(TelegramObject): Source: https://core.telegram.org/bots/api#suggestedpostapproved """ - send_date: int + send_date: DateTime """Date when the post will be published""" suggested_post_message: Optional[Message] = None """*Optional*. Message containing the suggested post. Note that the :class:`aiogram.types.message.Message` object in this field will not contain the *reply_to_message* field even if it itself is a reply.""" @@ -30,7 +31,7 @@ class SuggestedPostApproved(TelegramObject): def __init__( __pydantic__self__, *, - send_date: int, + send_date: DateTime, suggested_post_message: Optional[Message] = None, price: Optional[SuggestedPostPrice] = None, **__pydantic_kwargs: Any, diff --git a/aiogram/types/suggested_post_parameters.py b/aiogram/types/suggested_post_parameters.py index 9abb450c..b48dbb98 100644 --- a/aiogram/types/suggested_post_parameters.py +++ b/aiogram/types/suggested_post_parameters.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional from .base import TelegramObject +from .custom import DateTime if TYPE_CHECKING: from .suggested_post_price import SuggestedPostPrice @@ -17,7 +18,7 @@ class SuggestedPostParameters(TelegramObject): price: Optional[SuggestedPostPrice] = None """*Optional*. Proposed price for the post. If the field is omitted, then the post is unpaid.""" - send_date: Optional[int] = None + send_date: Optional[DateTime] = None """*Optional*. Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it.""" if TYPE_CHECKING: @@ -28,7 +29,7 @@ class SuggestedPostParameters(TelegramObject): __pydantic__self__, *, price: Optional[SuggestedPostPrice] = None, - send_date: Optional[int] = None, + send_date: Optional[DateTime] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!!