new feature eventReminder added

This commit is contained in:
Manvydas Kriauciunas
2017-10-06 16:23:47 +02:00
parent 023fd58f05
commit d38f8ad2ec
2 changed files with 32 additions and 0 deletions

View File

@@ -1192,6 +1192,37 @@ class Client(object):
j = self._post('{}/?{}'.format(self.req_url.MESSAGE_REACTION, url_part), fix_request=True, as_json=True)
def eventReminder(self, thread_id, time, title, location='', location_id=''):
"""
Sets an event reminder
:param thread_id: :ref:`Thread ID <intro_thread_ids>` to send event to
:param time: Event time
:param title: Event title
:param location: Event location
:param location_ir: Event location ID
:raises: FBchatException if request failed
"""
full_data = {
"event_type": "EVENT",
"dpr": 1,
"event_time" : time,
"title" : title,
"thread_id" : thread_id,
"location_id" : location_id,
"location_name" : location,
"acontext": {
"action_history": [{
"surface": "messenger_chat_tab",
"mechanism": "messenger_composer"
}]
}
}
url_part = urllib.parse.urlencode(full_data)
j = self._post('{}/?{}'.format(self.req_url.EVENT_REMINDER, url_part), fix_request=True, as_json=True)
def setTypingStatus(self, status, thread_id=None, thread_type=None):
"""
Sets users typing status in a thread

View File

@@ -92,6 +92,7 @@ class ReqUrl(object):
MESSAGE_REACTION = "https://www.facebook.com/webgraphql/mutation"
TYPING = "https://www.facebook.com/ajax/messaging/typ.php"
GRAPHQL = "https://www.facebook.com/api/graphqlbatch/"
EVENT_REMINDER = "https://www.facebook.com/ajax/eventreminder/create"
pull_channel = 0