mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Make is_member field actually working
This commit is contained in:
parent
b056aa8d7f
commit
58482919ba
@ -126,17 +126,11 @@ class ChatMember(PyrogramType):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if isinstance(member, types.ChannelParticipantBanned):
|
if isinstance(member, types.ChannelParticipantBanned):
|
||||||
status = (
|
|
||||||
"kicked" if member.banned_rights.view_messages
|
|
||||||
else "left" if member.left
|
|
||||||
else "restricted"
|
|
||||||
)
|
|
||||||
|
|
||||||
return ChatMember(
|
return ChatMember(
|
||||||
user=user,
|
user=user,
|
||||||
status=status,
|
status="kicked" if member.banned_rights.view_messages else "restricted",
|
||||||
date=member.date,
|
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]),
|
restricted_by=pyrogram.User._parse(client, users[member.kicked_by]),
|
||||||
permissions=pyrogram.ChatPermissions._parse(member),
|
permissions=pyrogram.ChatPermissions._parse(member),
|
||||||
client=client
|
client=client
|
||||||
|
Loading…
x
Reference in New Issue
Block a user