@@ -278,7 +278,7 @@ def __init__(self, update_id, message, edited_message, channel_post, edited_chan
278278 self.edited_business_message: Optional[Message] = edited_business_message
279279 self.deleted_business_messages: Optional[BusinessMessagesDeleted] = deleted_business_messages
280280 self.purchased_paid_media: Optional[PaidMediaPurchased] = purchased_paid_media
281- self.managed_bot: Optional[User ] = managed_bot
281+ self.managed_bot: Optional[ManagedBotUpdated ] = managed_bot
282282
283283class ChatMemberUpdated(JsonDeserializable):
284284 """
@@ -1780,7 +1780,7 @@ def __init__(self, message_id, from_user, date, chat, content_type, options, jso
17801780 self.managed_bot_created: Optional[ManagedBotCreated] = None
17811781 self.poll_option_added: Optional[PollOptionAdded] = None
17821782 self.poll_option_deleted: Optional[PollOptionDeleted] = None
1783- self.reply_to_poll_option_id: Optional[int ] = None
1783+ self.reply_to_poll_option_id: Optional[str ] = None
17841784
17851785 for key in options:
17861786 setattr(self, key, options[key])
@@ -7714,15 +7714,11 @@ def to_json(self):
77147714
77157715 def to_dict(self):
77167716 # Left for backward compatibility, but with no support for voter_chat
7717+ logger.warning("PollAnswer.to_dict is deprecated and will be removed in future versions.")
77177718 json_dict = {
77187719 "poll_id": self.poll_id,
77197720 "option_ids": self.option_ids,
7720- "option_persistent_ids": self.option_persistent_ids
77217721 }
7722- if self.user:
7723- json_dict["user"] = self.user.to_dict()
7724- if self.voter_chat:
7725- json_dict["voter_chat"] = self.voter_chat
77267722 return json_dict
77277723
77287724
@@ -13911,7 +13907,7 @@ def de_json(cls, json_string):
1391113907 return cls(**obj)
1391213908
1391313909
13914- class PreparedKeyboardButton(JsonSerializable ):
13910+ class PreparedKeyboardButton(JsonDeserializable ):
1391513911 """
1391613912 Describes a keyboard button to be used by a user of a Mini App.
1391713913
@@ -13926,14 +13922,11 @@ class PreparedKeyboardButton(JsonSerializable):
1392613922 def __init__(self, id: str, **kwargs):
1392713923 self.id: str = id
1392813924
13929- def to_json(self):
13930- return json.dumps(self.to_dict())
13931-
13932- def to_dict(self):
13933- data = {
13934- 'id': self.id
13935- }
13936- return data
13925+ @classmethod
13926+ def de_json(cls, json_string):
13927+ if json_string is None: return None
13928+ obj = cls.check_json(json_string)
13929+ return cls(**obj)
1393713930
1393813931
1393913932class PollOptionAdded(JsonDeserializable):
0 commit comments