From 36742bf30b2f8456a0a4a618e49ee2e2df24ff2f Mon Sep 17 00:00:00 2001 From: ThatAlexanderA <38069912+ThatAlexanderA@users.noreply.github.com> Date: Mon, 4 Jun 2018 16:16:53 +0200 Subject: [PATCH] Added remove friend def --- fbchat/client.py | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/fbchat/client.py b/fbchat/client.py index 5e79bd9..2cd5ec0 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -468,30 +468,14 @@ class Client(object): """ END DEFAULT THREAD METHODS """ - def removefriend(self, friend_id=None): - r = self._get(self.req_url.REMOVE_FRIENDFIRST + friend_id) - soup = bs(r.text, "lxml") - fb_dtsg_value = soup.find('input', {'name': 'fb_dtsg'}).get('value') - print self._session.cookies.get_dict().get('c_user') - print self._session.cookies.get_dict().get('xs') - payload = [ - { - "name": "fb_dtsg", - "value": fb_dtsg_value - }, - { - "name": "friend_id", - "value": friend_id - }, - { - "name": "unref", - "value": "none" - }, - { - "name": "confirm", - "value": "Confirm" - }] - r = self._post(self.req_url.REMOVE_FRIENDSECOND,payload) + def removeFriend(self, friend_id=None): + :param friend_id: The id of the friend that you want to remove + payload = { + "friend_id": friend_id, + "unref": "none", + "confirm": "Confirm", + } + r = self._post(self.req_url.REMOVE_FRIEND,payload) return r.ok """ FETCH METHODS