Skip to content

Commit 74ecd2b

Browse files
committed
Add missing members_count attribute when parsing chats
1 parent 8d70023 commit 74ecd2b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • pyrogram/client/types/user_and_chats

pyrogram/client/types/user_and_chats/chat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def _parse_chat_chat(client, chat: types.Chat) -> "Chat":
170170
title=chat.title,
171171
photo=ChatPhoto._parse(client, getattr(chat, "photo", None), peer_id),
172172
permissions=ChatPermissions._parse(getattr(chat, "default_banned_rights", None)),
173+
members_count=getattr(chat, "participants_count", None),
173174
client=client
174175
)
175176

@@ -188,6 +189,7 @@ def _parse_channel_chat(client, channel: types.Channel) -> "Chat":
188189
photo=ChatPhoto._parse(client, getattr(channel, "photo", None), peer_id),
189190
restriction_reason=getattr(channel, "restriction_reason", None),
190191
permissions=ChatPermissions._parse(getattr(channel, "default_banned_rights", None)),
192+
members_count=getattr(channel, "participants_count", None),
191193
client=client
192194
)
193195

@@ -715,7 +717,6 @@ def leave(self):
715717

716718
return self._client.leave_chat(self.id)
717719

718-
719720
def export_invite_link(self):
720721
"""Bound method *export_invite_link* of :obj:`Chat`.
721722

0 commit comments

Comments
 (0)