mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Replace BusinessConnection.date type
This commit is contained in:
parent
61d1bcdd96
commit
8048a6428b
3 changed files with 9 additions and 3 deletions
5
.butcher/types/BusinessConnection/replace.yml
Normal file
5
.butcher/types/BusinessConnection/replace.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
annotations:
|
||||
date:
|
||||
parsed_type:
|
||||
type: std
|
||||
name: DateTime
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue