1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Added the field via_chat_folder_invite_link to the class ChatMemberUpdated.

This commit is contained in:
coder2020official 2023-04-21 22:30:32 +04:00
parent 966b451869
commit d6f4987197

View File

@ -237,6 +237,9 @@ class ChatMemberUpdated(JsonDeserializable):
link events only. link events only.
:type invite_link: :class:`telebot.types.ChatInviteLink` :type invite_link: :class:`telebot.types.ChatInviteLink`
:param via_chat_folder_invite_link: Optional. True, if the user joined the chat via a chat folder invite link
:type via_chat_folder_invite_link: :obj:`bool`
:return: Instance of the class :return: Instance of the class
:rtype: :class:`telebot.types.ChatMemberUpdated` :rtype: :class:`telebot.types.ChatMemberUpdated`
""" """
@ -251,13 +254,15 @@ class ChatMemberUpdated(JsonDeserializable):
obj['invite_link'] = ChatInviteLink.de_json(obj.get('invite_link')) obj['invite_link'] = ChatInviteLink.de_json(obj.get('invite_link'))
return cls(**obj) return cls(**obj)
def __init__(self, chat, from_user, date, old_chat_member, new_chat_member, invite_link=None, **kwargs): def __init__(self, chat, from_user, date, old_chat_member, new_chat_member, invite_link=None, via_chat_folder_invite_link=None,
**kwargs):
self.chat: Chat = chat self.chat: Chat = chat
self.from_user: User = from_user self.from_user: User = from_user
self.date: int = date self.date: int = date
self.old_chat_member: ChatMember = old_chat_member self.old_chat_member: ChatMember = old_chat_member
self.new_chat_member: ChatMember = new_chat_member self.new_chat_member: ChatMember = new_chat_member
self.invite_link: Optional[ChatInviteLink] = invite_link self.invite_link: Optional[ChatInviteLink] = invite_link
self.via_chat_folder_invite_link: Optional[bool] = via_chat_folder_invite_link
@property @property
def difference(self) -> Dict[str, List]: def difference(self) -> Dict[str, List]: