Unsending messages

This commit is contained in:
Kacper Ziubryniewicz
2018-12-09 14:36:23 +01:00
parent 8739318101
commit 41bbe18e3d
2 changed files with 13 additions and 0 deletions

View File

@@ -1116,6 +1116,18 @@ class Client(object):
data['specific_to_list[0]'] = "fbid:{}".format(thread_id) data['specific_to_list[0]'] = "fbid:{}".format(thread_id)
return self._doSendRequest(data) return self._doSendRequest(data)
def unsend(self, mid):
"""
Unsends a message (removes for everyone)
:param mid: :ref:`Message ID <intro_message_ids>` 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): def _sendLocation(self, location, current=True, thread_id=None, thread_type=None):
thread_id, thread_type = self._getThread(thread_id, thread_type) thread_id, thread_type = self._getThread(thread_id, thread_type)
data = self._getSendData(thread_id=thread_id, thread_type=thread_type) data = self._getSendData(thread_id=thread_id, thread_type=thread_type)

View File

@@ -141,6 +141,7 @@ class ReqUrl(object):
GET_POLL_OPTIONS = "https://www.facebook.com/ajax/mercury/get_poll_options" 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" 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" 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 pull_channel = 0