diff --git a/fbchat/client.py b/fbchat/client.py index 3b28f2d..795b280 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -1116,6 +1116,18 @@ class Client(object): data['specific_to_list[0]'] = "fbid:{}".format(thread_id) return self._doSendRequest(data) + def unsend(self, mid): + """ + Unsends a message (removes for everyone) + + :param mid: :ref:`Message ID ` of the message to unsend + """ + data = { + 'message_id': mid, + } + r = self._post(self.req_url.UNSEND, data) + r.raise_for_status() + def _sendLocation(self, location, current=True, thread_id=None, thread_type=None): thread_id, thread_type = self._getThread(thread_id, thread_type) data = self._getSendData(thread_id=thread_id, thread_type=thread_type) diff --git a/fbchat/utils.py b/fbchat/utils.py index 7d8003f..c39e652 100644 --- a/fbchat/utils.py +++ b/fbchat/utils.py @@ -141,6 +141,7 @@ class ReqUrl(object): GET_POLL_OPTIONS = "https://www.facebook.com/ajax/mercury/get_poll_options" SEARCH_MESSAGES = "https://www.facebook.com/ajax/mercury/search_snippets.php?dpr=1" MARK_SPAM = "https://www.facebook.com/ajax/mercury/mark_spam.php?dpr=1" + UNSEND = "https://www.facebook.com/messaging/unsend_message/?dpr=1" pull_channel = 0