From b919ed82420c9358dcb5c73858d5fc4fd0a55193 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 21 Jan 2019 16:53:54 +0100 Subject: [PATCH] Add restricted_by attribute in ChatMember (#204) --- pyrogram/client/types/user_and_chats/chat_member.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyrogram/client/types/user_and_chats/chat_member.py b/pyrogram/client/types/user_and_chats/chat_member.py index c2dbccbd..590a67e5 100644 --- a/pyrogram/client/types/user_and_chats/chat_member.py +++ b/pyrogram/client/types/user_and_chats/chat_member.py @@ -43,6 +43,9 @@ class ChatMember(PyrogramType): promoted_by (:obj:`User `, *optional*): Administrators only. Information about the user who promoted this member as administrator. + restricted_by (:obj:`User `, *optional*): + Restricted and kicked only. Information about the user who restricted or kicked this member. + until_date (``int``, *optional*): Restricted and kicked only. Date when restrictions will be lifted for this user, unix time. @@ -99,6 +102,7 @@ class ChatMember(PyrogramType): date: int = None, invited_by: "pyrogram.User" = None, promoted_by: "pyrogram.User" = None, + restricted_by: "pyrogram.User" = None, until_date: int = None, can_be_edited: bool = None, can_change_info: bool = None, @@ -120,6 +124,7 @@ class ChatMember(PyrogramType): self.date = date self.invited_by = invited_by self.promoted_by = promoted_by + self.restricted_by = restricted_by self.until_date = until_date self.can_be_edited = can_be_edited self.can_change_info = can_change_info @@ -181,6 +186,7 @@ class ChatMember(PyrogramType): else "restricted" ), date=member.date, + restricted_by=pyrogram.User._parse(client, users[member.kicked_by]), until_date=0 if rights.until_date == (1 << 31) - 1 else rights.until_date, client=client )