From 17daa1e73335125cbcc13664365f9d44afa93042 Mon Sep 17 00:00:00 2001 From: Suren Khorenyan Date: Sun, 31 Dec 2023 00:58:00 +0300 Subject: [PATCH] update Giveaway objects Unix time field to DateTime type --- aiogram/types/giveaway.py | 5 +++-- aiogram/types/giveaway_winners.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/aiogram/types/giveaway.py b/aiogram/types/giveaway.py index c48df048..1fa4f508 100644 --- a/aiogram/types/giveaway.py +++ b/aiogram/types/giveaway.py @@ -6,6 +6,7 @@ from .base import TelegramObject if TYPE_CHECKING: from .chat import Chat + from .custom import DateTime class Giveaway(TelegramObject): @@ -17,7 +18,7 @@ class Giveaway(TelegramObject): chats: List[Chat] """The list of chats which the user must join to participate in the giveaway""" - winners_selection_date: int + winners_selection_date: DateTime """Point in time (Unix timestamp) when winners of the giveaway will be selected""" winner_count: int """The number of users which are supposed to be selected as winners of the giveaway""" @@ -40,7 +41,7 @@ class Giveaway(TelegramObject): __pydantic__self__, *, chats: List[Chat], - winners_selection_date: int, + winners_selection_date: DateTime, winner_count: int, only_new_members: Optional[bool] = None, has_public_winners: Optional[bool] = None, diff --git a/aiogram/types/giveaway_winners.py b/aiogram/types/giveaway_winners.py index 838a0da1..41a4b5ca 100644 --- a/aiogram/types/giveaway_winners.py +++ b/aiogram/types/giveaway_winners.py @@ -6,6 +6,7 @@ from .base import TelegramObject if TYPE_CHECKING: from .chat import Chat + from .custom import DateTime from .user import User @@ -20,7 +21,7 @@ class GiveawayWinners(TelegramObject): """The chat that created the giveaway""" giveaway_message_id: int """Identifier of the messsage with the giveaway in the chat""" - winners_selection_date: int + winners_selection_date: DateTime """Point in time (Unix timestamp) when winners of the giveaway were selected""" winner_count: int """Total number of winners in the giveaway""" @@ -48,7 +49,7 @@ class GiveawayWinners(TelegramObject): *, chat: Chat, giveaway_message_id: int, - winners_selection_date: int, + winners_selection_date: DateTime, winner_count: int, winners: List[User], additional_chat_count: Optional[int] = None,