Switch send_date type from int to DateTime in suggested post models

This commit is contained in:
JRoot Junior 2025-08-17 19:03:26 +03:00
parent 48b04c81f6
commit c56da467ad
No known key found for this signature in database
GPG key ID: 738964250D5FF6E2
4 changed files with 16 additions and 4 deletions

View file

@ -0,0 +1,5 @@
annotations:
send_date:
parsed_type:
type: std
name: DateTime

View file

@ -0,0 +1,5 @@
annotations:
send_date:
parsed_type:
type: std
name: DateTime

View file

@ -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,

View file

@ -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!!!