2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-30 05:48:14 +00:00

Add restricted_by attribute in ChatMember (#204)

This commit is contained in:
Dan 2019-01-21 16:53:54 +01:00
parent f0c8f65e9d
commit b919ed8242

View File

@ -43,6 +43,9 @@ class ChatMember(PyrogramType):
promoted_by (:obj:`User <pyrogram.User>`, *optional*):
Administrators only. Information about the user who promoted this member as administrator.
restricted_by (:obj:`User <pyrogram.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
)