diff --git a/.butcher/types/BusinessConnection/replace.yml b/.butcher/types/BusinessConnection/replace.yml new file mode 100644 index 00000000..80c48d76 --- /dev/null +++ b/.butcher/types/BusinessConnection/replace.yml @@ -0,0 +1,5 @@ +annotations: + date: + parsed_type: + type: std + name: DateTime diff --git a/aiogram/types/business_connection.py b/aiogram/types/business_connection.py index 11506d5f..570aa45d 100644 --- a/aiogram/types/business_connection.py +++ b/aiogram/types/business_connection.py @@ -2,6 +2,7 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any +from .custom import DateTime from .base import TelegramObject if TYPE_CHECKING: @@ -21,7 +22,7 @@ class BusinessConnection(TelegramObject): """Business account user that created the business connection""" user_chat_id: int """Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.""" - date: int + date: DateTime """Date the connection was established in Unix time""" can_reply: bool """True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours""" @@ -38,7 +39,7 @@ class BusinessConnection(TelegramObject): id: str, user: User, user_chat_id: int, - date: int, + date: DateTime, can_reply: bool, is_enabled: bool, **__pydantic_kwargs: Any, diff --git a/tests/test_dispatcher/test_dispatcher.py b/tests/test_dispatcher/test_dispatcher.py index e5fed1a4..56a44e6f 100644 --- a/tests/test_dispatcher/test_dispatcher.py +++ b/tests/test_dispatcher/test_dispatcher.py @@ -548,7 +548,7 @@ class TestDispatcher: id="qwerty", user=User(id=42, is_bot=False, first_name="Test"), user_chat_id=42, - date=int(time.time()), + date=datetime.datetime.now(), can_reply=True, is_enabled=True, ),