diff --git a/pyrogram/client/methods/chats/kick_chat_member.py b/pyrogram/client/methods/chats/kick_chat_member.py index 1c849285..e0efa722 100644 --- a/pyrogram/client/methods/chats/kick_chat_member.py +++ b/pyrogram/client/methods/chats/kick_chat_member.py @@ -17,6 +17,7 @@ # along with Pyrogram. If not, see . from pyrogram.api import functions, types +from pyrogram.client.ext import utils from ...ext import BaseClient @@ -58,7 +59,7 @@ class KickChatMember(BaseClient): user_peer = self.resolve_peer(user_id) if isinstance(chat_peer, types.InputPeerChannel): - self.send( + r = self.send( functions.channels.EditBanned( channel=chat_peer, user_id=user_peer, @@ -76,11 +77,17 @@ class KickChatMember(BaseClient): ) ) else: - self.send( + r = self.send( functions.messages.DeleteChatUser( chat_id=abs(chat_id), user_id=user_peer ) ) - return True + for i in r.updates: + if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)): + return utils.parse_messages( + self, i.message, + {i.id: i for i in r.users}, + {i.id: i for i in r.chats} + )