From 58482919ba826b36d5e7b60e8e9203c4f715093a Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 5 May 2019 12:21:20 +0200 Subject: [PATCH] Make is_member field actually working --- pyrogram/client/types/user_and_chats/chat_member.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pyrogram/client/types/user_and_chats/chat_member.py b/pyrogram/client/types/user_and_chats/chat_member.py index 9ccf9314..046d2ebc 100644 --- a/pyrogram/client/types/user_and_chats/chat_member.py +++ b/pyrogram/client/types/user_and_chats/chat_member.py @@ -126,17 +126,11 @@ class ChatMember(PyrogramType): ) if isinstance(member, types.ChannelParticipantBanned): - status = ( - "kicked" if member.banned_rights.view_messages - else "left" if member.left - else "restricted" - ) - return ChatMember( user=user, - status=status, + status="kicked" if member.banned_rights.view_messages else "restricted", date=member.date, - is_member=not member.left if status == "restricted" else None, + is_member=not member.left, restricted_by=pyrogram.User._parse(client, users[member.kicked_by]), permissions=pyrogram.ChatPermissions._parse(member), client=client