2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 05:18:10 +00:00

Add promoted_by attribute in ChatMember (#204)

This commit is contained in:
Dan 2019-01-21 16:41:56 +01:00
parent 16b7203ee9
commit f0c8f65e9d

View File

@ -37,9 +37,12 @@ class ChatMember(PyrogramType):
Date when the user joined, unix time. Not available for creator. Date when the user joined, unix time. Not available for creator.
invited_by (:obj:`User <pyrogram.User>`, *optional*): invited_by (:obj:`User <pyrogram.User>`, *optional*):
Information about the user who invited this member. Administrators and self member only. Information about the user who invited this member.
In case the user joined by himself this will be the same as "user". In case the user joined by himself this will be the same as "user".
promoted_by (:obj:`User <pyrogram.User>`, *optional*):
Administrators only. Information about the user who promoted this member as administrator.
until_date (``int``, *optional*): until_date (``int``, *optional*):
Restricted and kicked only. Date when restrictions will be lifted for this user, unix time. Restricted and kicked only. Date when restrictions will be lifted for this user, unix time.
@ -95,6 +98,7 @@ class ChatMember(PyrogramType):
status: str, status: str,
date: int = None, date: int = None,
invited_by: "pyrogram.User" = None, invited_by: "pyrogram.User" = None,
promoted_by: "pyrogram.User" = None,
until_date: int = None, until_date: int = None,
can_be_edited: bool = None, can_be_edited: bool = None,
can_change_info: bool = None, can_change_info: bool = None,
@ -115,6 +119,7 @@ class ChatMember(PyrogramType):
self.status = status self.status = status
self.date = date self.date = date
self.invited_by = invited_by self.invited_by = invited_by
self.promoted_by = promoted_by
self.until_date = until_date self.until_date = until_date
self.can_be_edited = can_be_edited self.can_be_edited = can_be_edited
self.can_change_info = can_change_info self.can_change_info = can_change_info
@ -152,6 +157,7 @@ class ChatMember(PyrogramType):
status="administrator", status="administrator",
date=member.date, date=member.date,
invited_by=invited_by, invited_by=invited_by,
promoted_by=pyrogram.User._parse(client, users[member.promoted_by]),
can_be_edited=member.can_edit, can_be_edited=member.can_edit,
can_change_info=rights.change_info, can_change_info=rights.change_info,
can_post_messages=rights.post_messages, can_post_messages=rights.post_messages,