From 26444104bedd795d26d1f017753186aa34d97dfd Mon Sep 17 00:00:00 2001 From: Sven Skender Date: Sat, 12 Nov 2016 19:49:07 +0100 Subject: [PATCH] Update client.py to kick chat participants remove_user_from_chat(threadID, userID) --- fbchat/client.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/fbchat/client.py b/fbchat/client.py index 777de09..95e1e80 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -39,6 +39,7 @@ StickyURL ="https://0-edge-chat.facebook.com/pull" PingURL ="https://0-channel-proxy-06-ash2.facebook.com/active_ping" UploadURL ="https://upload.facebook.com/ajax/mercury/upload.php" UserInfoURL ="https://www.facebook.com/chat/user_info/" +RemoveUserURL="https://www.facebook.com/chat/remove_participants/" class Client(object): """A client for the Facebook Chat (Messenger). @@ -574,6 +575,24 @@ class Client(object): return full_data + def remove_user_from_chat(self, threadID, userID): + """Remove user (userID) from group chat (threadID) + + :param threadID: group chat id + :param userID: user id to remove from chat + """ + + data = { + "uid" : userID, + "tid" : threadID + } + + r = self._post(RemoveUserURL, data) + + self._console(r) + self._console(data) + + return r.ok