Skip to content

Commit c253e6e

Browse files
committed
Add admin_privileges in Chat
1 parent 85cfdf4 commit c253e6e

File tree

1 file changed

+6
-0
lines changed
  • pyrogram/types/user_and_chats

1 file changed

+6
-0
lines changed

pyrogram/types/user_and_chats/chat.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ class Chat(Object):
118118
permissions (:obj:`~pyrogram.types.ChatPermissions` *optional*):
119119
Default chat member permissions, for groups and supergroups.
120120
121+
admin_privileges (:obj:`~pyrogram.types.ChatPrivileges`, *optional*):
122+
Administrator Privileges of the current logged in user in the current chat. Only for supergroups and channels. None if the current user is not an Administrator.
123+
121124
can_send_paid_media (``bool``, *optional*):
122125
True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.
123126
@@ -279,6 +282,7 @@ def __init__(
279282
members_count: int = None,
280283
restrictions: list["types.Restriction"] = None,
281284
permissions: "types.ChatPermissions" = None,
285+
admin_privileges: "types.ChatPrivileges" = None,
282286
distance: int = None,
283287
linked_chat: "types.Chat" = None,
284288
send_as_chat: "types.Chat" = None,
@@ -343,6 +347,7 @@ def __init__(
343347
self.members_count = members_count
344348
self.restrictions = restrictions
345349
self.permissions = permissions
350+
self.admin_privileges = admin_privileges
346351
self.distance = distance
347352
self.linked_chat = linked_chat
348353
self.send_as_chat = send_as_chat
@@ -535,6 +540,7 @@ def _parse_channel_chat(client, channel: raw.types.Channel) -> "Chat":
535540
]
536541
) or None,
537542
permissions=types.ChatPermissions._parse(getattr(channel, "default_banned_rights", None)),
543+
admin_privileges=types.ChatPrivileges._parse(getattr(channel, "admin_rights", None)),
538544
members_count=getattr(channel, "participants_count", 0),
539545
dc_id=getattr(getattr(channel, "photo", None), "dc_id", None),
540546
has_protected_content=getattr(channel, "noforwards", None),

0 commit comments

Comments
 (0)