diff --git a/fbchat/client.py b/fbchat/client.py index 110653b..8f341a8 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -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 ` 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 diff --git a/fbchat/utils.py b/fbchat/utils.py index 7d3434b..61f0f14 100644 --- a/fbchat/utils.py +++ b/fbchat/utils.py @@ -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