Skip to content

Commit a848089

Browse files
Added the field parent_chat to the class ChatFullInfo which indicates the parent channel chat for a channel direct messages chat.
1 parent c29dd9a commit a848089

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

telebot/types.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,9 @@ class ChatFullInfo(JsonDeserializable):
642642
:param personal_chat: Optional. For private chats, the personal channel of the user. Returned only in getChat.
643643
:type personal_chat: :class:`telebot.types.Chat`
644644

645+
:param parent_chat: Optional. Information about the corresponding channel chat; for direct messages chats only
646+
:type parent_chat: :class:`telebot.types.Chat`
647+
645648
:param available_reactions: Optional. List of available chat reactions; for private chats, supergroups and channels. Returned only in getChat.
646649
:type available_reactions: :obj:`list` of :class:`telebot.types.ReactionType`
647650

@@ -770,6 +773,8 @@ def de_json(cls, json_string):
770773
obj['birthdate'] = Birthdate.de_json(obj['birthdate'])
771774
if 'accepted_gift_types' in obj:
772775
obj['accepted_gift_types'] = AcceptedGiftTypes.de_json(obj['accepted_gift_types'])
776+
if 'parent_chat' in obj:
777+
obj['parent_chat'] = Chat.de_json(obj['parent_chat'])
773778
return cls(**obj)
774779

775780
def __init__(self, id, type, title=None, username=None, first_name=None,
@@ -786,7 +791,7 @@ def __init__(self, id, type, title=None, username=None, first_name=None,
786791
unrestrict_boost_count=None, custom_emoji_sticker_set_name=None, business_intro=None, business_location=None,
787792
business_opening_hours=None, personal_chat=None, birthdate=None,
788793
can_send_paid_media=None,
789-
accepted_gift_types=None, is_direct_messages=None, **kwargs):
794+
accepted_gift_types=None, is_direct_messages=None, parent_chat=None, **kwargs):
790795
self.id: int = id
791796
self.type: str = type
792797
self.title: Optional[str] = title
@@ -833,6 +838,7 @@ def __init__(self, id, type, title=None, username=None, first_name=None,
833838
self.can_send_paid_media: Optional[bool] = can_send_paid_media
834839
self.accepted_gift_types: AcceptedGiftTypes = accepted_gift_types
835840
self.is_direct_messages: Optional[bool] = is_direct_messages
841+
self.parent_chat: Optional[Chat] = parent_chat
836842
@property
837843
def can_send_gift(self) -> bool:
838844
"""

0 commit comments

Comments
 (0)