File tree Expand file tree Collapse file tree
pyrogram/client/methods/chats Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,26 +47,30 @@ def get_chat_member(
4747 Raises:
4848 RPCError: In case of a Telegram RPC error.
4949 """
50- chat_id = self .resolve_peer (chat_id )
51- user_id = self .resolve_peer (user_id )
50+ chat = self .resolve_peer (chat_id )
51+ user = self .resolve_peer (user_id )
5252
53- if isinstance (chat_id , types .InputPeerChat ):
53+ if isinstance (chat , types .InputPeerChat ):
5454 full_chat = self .send (
5555 functions .messages .GetFullChat (
56- chat_id = chat_id .chat_id
56+ chat_id = chat .chat_id
5757 )
5858 )
5959
6060 for member in pyrogram .ChatMembers ._parse (self , full_chat ).chat_members :
61- if member .user .is_self :
62- return member
61+ if isinstance (user , types .InputPeerSelf ):
62+ if member .user .is_self :
63+ return member
64+ else :
65+ if member .user .id == user .user_id :
66+ return member
6367 else :
6468 raise UserNotParticipant
65- elif isinstance (chat_id , types .InputPeerChannel ):
69+ elif isinstance (chat , types .InputPeerChannel ):
6670 r = self .send (
6771 functions .channels .GetParticipant (
68- channel = chat_id ,
69- user_id = user_id
72+ channel = chat ,
73+ user_id = user
7074 )
7175 )
7276
You can’t perform that action at this time.
0 commit comments