From 3768412a1a04a300695b5ad8fa26c48a0d735146 Mon Sep 17 00:00:00 2001 From: karl Date: Thu, 25 Aug 2016 16:21:26 +0900 Subject: [PATCH 01/15] #7, Trigger message_handler, postback_handler even if custom callbacks are used --- fbmq/fbmq.py | 6 ++---- tests/test_page.py | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/fbmq/fbmq.py b/fbmq/fbmq.py index 6ef8d7b..19a6208 100644 --- a/fbmq/fbmq.py +++ b/fbmq/fbmq.py @@ -47,15 +47,13 @@ def handle_webhook(self, payload, optin=None, message=None, echo=None, delivery= self._call_handler('echo', echo, event) elif self.is_quick_reply(event) and self.has_quick_reply_callback(event): self.call_quick_reply_callback(event) - else: - self._call_handler('message', message, event) + self._call_handler('message', message, event) elif 'delivery' in event: self._call_handler('delivery', delivery, event) elif 'postback' in event: if self.has_postback_callback(event): self.call_postback_callback(event) - else: - self._call_handler('postback', postback, event) + self._call_handler('postback', postback, event) elif 'read' in event: self._call_handler('read', read, event) elif 'account_linking' in event: diff --git a/tests/test_page.py b/tests/test_page.py index 199f14b..5ccdf47 100644 --- a/tests/test_page.py +++ b/tests/test_page.py @@ -265,7 +265,7 @@ def button_callback(payload, event): self.page.handle_webhook(payload, postback=handler1) - self.assertEquals(0, counter1.call_count) + self.assertEquals(1, counter1.call_count) self.assertEquals(1, counter2.call_count) payload = """ @@ -276,7 +276,7 @@ def button_callback(payload, event): }]} """ self.page.handle_webhook(payload, postback=handler1) - self.assertEquals(1, counter1.call_count) + self.assertEquals(2, counter1.call_count) self.assertEquals(1, counter2.call_count) def test_handle_webhook_quickreply_callback(self): @@ -299,7 +299,7 @@ def button_callback(payload, event): self.page.handle_webhook(payload, postback=handler1) - self.assertEquals(0, counter1.call_count) + self.assertEquals(1, counter1.call_count) self.assertEquals(1, counter2.call_count) payload = """ @@ -309,7 +309,7 @@ def button_callback(payload, event): "message":{"quick_reply":{"payload":"PICK_COMEDY"},"mid":"mid.1472028637817:ae2763cc036a664b43","seq":834,"text":"Action"}}]}]} """ self.page.handle_webhook(payload, postback=handler1) - self.assertEquals(1, counter1.call_count) + self.assertEquals(2, counter1.call_count) self.assertEquals(1, counter2.call_count) def test_callback_regex_pattern(self): From fb6a493fe722211e776dbb797155c3a3118f97de Mon Sep 17 00:00:00 2001 From: karl Date: Thu, 25 Aug 2016 16:55:33 +0900 Subject: [PATCH 02/15] #8, add a page option, after_send function --- example/fbpage.py | 6 +++++- fbmq/fbmq.py | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/example/fbpage.py b/example/fbpage.py index dcac706..e640870 100644 --- a/example/fbpage.py +++ b/example/fbpage.py @@ -1,4 +1,8 @@ from fbmq import Page from config import CONFIG -page = Page(CONFIG['FACEBOOK_TOKEN']) \ No newline at end of file + +def after_send(payload): + print('AFTER_SEND : ' + payload.to_json()) + +page = Page(CONFIG['FACEBOOK_TOKEN'], after_send=after_send) \ No newline at end of file diff --git a/fbmq/fbmq.py b/fbmq/fbmq.py index 19a6208..8f717a0 100644 --- a/fbmq/fbmq.py +++ b/fbmq/fbmq.py @@ -6,8 +6,9 @@ class Page(object): - def __init__(self, page_access_token): + def __init__(self, page_access_token, **options): self.page_access_token = page_access_token + self.after_send = options.pop('after_send', None) # webhook_handlers contains optin, message, echo, delivery, postback, read, account_linking. # these are only set by decorators @@ -19,6 +20,8 @@ def __init__(self, page_access_token): _quick_reply_callbacks_key_regex = {} _button_callbacks_key_regex = {} + after_send = None + def _call_handler(self, name, func, *args, **kwargs): if func is not None: func(*args, **kwargs) @@ -99,6 +102,10 @@ def _send(self, payload): params={"access_token": self.page_access_token}, data=payload.to_json(), headers={'Content-type': 'application/json'}) + + if self.after_send is not None: + self.after_send(payload) + if r.status_code != requests.codes.ok: print(r.text) From a6b7302a21f2a2bd2b84d5aea62fa7526a55d408 Mon Sep 17 00:00:00 2001 From: karl Date: Thu, 25 Aug 2016 17:06:22 +0900 Subject: [PATCH 03/15] #6, add a callback function in page.send --- example/fbpage.py | 3 ++- example/messenger.py | 6 +++++- fbmq/fbmq.py | 15 +++++++++------ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/example/fbpage.py b/example/fbpage.py index e640870..ac467d9 100644 --- a/example/fbpage.py +++ b/example/fbpage.py @@ -2,7 +2,8 @@ from config import CONFIG -def after_send(payload): +def after_send(payload, response): print('AFTER_SEND : ' + payload.to_json()) + print('RESPONSE : ' + response.text) page = Page(CONFIG['FACEBOOK_TOKEN'], after_send=after_send) \ No newline at end of file diff --git a/example/messenger.py b/example/messenger.py index 6e37c84..bead16c 100644 --- a/example/messenger.py +++ b/example/messenger.py @@ -136,7 +136,11 @@ def send_message(recipient_id, text): if text in special_keywords: special_keywords[text](recipient_id) else: - page.send(recipient_id, text) + page.send(recipient_id, text, callback=send_text_callback) + + +def send_text_callback(payload, response): + print("SEND CALLBACK") def send_image(recipient): diff --git a/fbmq/fbmq.py b/fbmq/fbmq.py index 8f717a0..a11b14d 100644 --- a/fbmq/fbmq.py +++ b/fbmq/fbmq.py @@ -97,19 +97,22 @@ def _fetch_page_info(self): self._page_id = data['id'] self._page_name = data['name'] - def _send(self, payload): + def _send(self, payload, callback=None): r = requests.post("https://graph.facebook.com/v2.6/me/messages", params={"access_token": self.page_access_token}, data=payload.to_json(), headers={'Content-type': 'application/json'}) - if self.after_send is not None: - self.after_send(payload) - if r.status_code != requests.codes.ok: print(r.text) - def send(self, recipient_id, message, quick_replies=None, metadata=None): + if self.after_send is not None: + self.after_send(payload=payload, response=r) + + if callback is not None: + callback(payload=payload, response=r) + + def send(self, recipient_id, message, quick_replies=None, metadata=None, callback=None): text = message if isinstance(message, str) else None attachment = message if not isinstance(message, str) else None @@ -119,7 +122,7 @@ def send(self, recipient_id, message, quick_replies=None, metadata=None): quick_replies=quick_replies, metadata=metadata)) - self._send(payload) + self._send(payload, callback=callback) def typing_on(self, recipient_id): payload = Payload(recipient=Recipient(id=recipient_id), From cbcca4ed23fcbd3f4d63d19902deee7383e850dc Mon Sep 17 00:00:00 2001 From: karl Date: Thu, 25 Aug 2016 17:10:37 +0900 Subject: [PATCH 04/15] update version to 1.7.0 --- CHANGELOG | 7 +++++++ fbmq/__init__.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 1a3be05..b780b61 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,13 @@ FBMQ Changelog Latest ------ +1.7.0 +----- + +* Fix, trigger message_handler, postback_handler even if custom callbacks are used +* Feature : Add a callback function in page.send +* Feature : Add a page option 'after_send' + 1.6.0 ----- diff --git a/fbmq/__init__.py b/fbmq/__init__.py index f56bba1..e7618e1 100644 --- a/fbmq/__init__.py +++ b/fbmq/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.6.0' +__version__ = '1.7.0' from .fbmq import QuickReply, Page from . import attachment as Attachment From 95f736b7a3cf18a2a77c9d396543ab6e61478e39 Mon Sep 17 00:00:00 2001 From: karl Date: Thu, 25 Aug 2016 17:23:54 +0900 Subject: [PATCH 05/15] update version 1.7.0b1 --- fbmq/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbmq/__init__.py b/fbmq/__init__.py index e7618e1..c28261e 100644 --- a/fbmq/__init__.py +++ b/fbmq/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.7.0' +__version__ = '1.7.0b1' from .fbmq import QuickReply, Page from . import attachment as Attachment From 5214b2930bdcbf1375a8d1b21099e281fd20b223 Mon Sep 17 00:00:00 2001 From: karl Date: Thu, 25 Aug 2016 17:30:34 +0900 Subject: [PATCH 06/15] After_send is supported decorator --- CHANGELOG | 2 +- example/fbpage.py | 7 ++++--- fbmq/__init__.py | 2 +- fbmq/fbmq.py | 11 +++++++---- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b780b61..1ef54a3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,7 +9,7 @@ Latest * Fix, trigger message_handler, postback_handler even if custom callbacks are used * Feature : Add a callback function in page.send -* Feature : Add a page option 'after_send' +* Feature : Add a page option 'after_send' (support decorator @page.after_send) 1.6.0 ----- diff --git a/example/fbpage.py b/example/fbpage.py index ac467d9..b57313a 100644 --- a/example/fbpage.py +++ b/example/fbpage.py @@ -1,9 +1,10 @@ from fbmq import Page from config import CONFIG +page = Page(CONFIG['FACEBOOK_TOKEN']) + +@page.after_send def after_send(payload, response): print('AFTER_SEND : ' + payload.to_json()) - print('RESPONSE : ' + response.text) - -page = Page(CONFIG['FACEBOOK_TOKEN'], after_send=after_send) \ No newline at end of file + print('RESPONSE : ' + response.text) \ No newline at end of file diff --git a/fbmq/__init__.py b/fbmq/__init__.py index c28261e..e14dc35 100644 --- a/fbmq/__init__.py +++ b/fbmq/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.7.0b1' +__version__ = '1.7.0b2' from .fbmq import QuickReply, Page from . import attachment as Attachment diff --git a/fbmq/fbmq.py b/fbmq/fbmq.py index a11b14d..0aa9ae6 100644 --- a/fbmq/fbmq.py +++ b/fbmq/fbmq.py @@ -8,7 +8,7 @@ class Page(object): def __init__(self, page_access_token, **options): self.page_access_token = page_access_token - self.after_send = options.pop('after_send', None) + self._after_send = options.pop('after_send', None) # webhook_handlers contains optin, message, echo, delivery, postback, read, account_linking. # these are only set by decorators @@ -20,7 +20,7 @@ def __init__(self, page_access_token, **options): _quick_reply_callbacks_key_regex = {} _button_callbacks_key_regex = {} - after_send = None + _after_send = None def _call_handler(self, name, func, *args, **kwargs): if func is not None: @@ -106,8 +106,8 @@ def _send(self, payload, callback=None): if r.status_code != requests.codes.ok: print(r.text) - if self.after_send is not None: - self.after_send(payload=payload, response=r) + if self._after_send is not None: + self._after_send(payload=payload, response=r) if callback is not None: callback(payload=payload, response=r) @@ -167,6 +167,9 @@ def handle_read(self, func): def handle_account_linking(self, func): self._webhook_handlers['account_linking'] = func + def after_send(self, func): + self._after_send = func + def callback_quick_reply(self, payloads=None): def wrapper(func): if payloads is None: From c366c6ea35668d3122d099cc6d6d985d42fca73a Mon Sep 17 00:00:00 2001 From: Karl Woojung Kim Date: Thu, 25 Aug 2016 17:38:40 +0900 Subject: [PATCH 07/15] Update README.md --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 391bb6a..d565066 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,10 @@ def message_handler(event): message = event['message'] page.send(sender_id, "thank you! your message is '%s'" % message) + +@page.after_send +def after_send(payload, response): + print("complete") ``` ### handlers @@ -70,8 +74,12 @@ def message_handler(event): `@page.handle_account_linking` - This callback will occur when the Linked Account or Unlink Account call-to-action have been tapped. +`@page.after_send` - This callback will occur when page.send function has been called. + #### if you don't need a decorator ```python +page = fbmq.Page(PAGE_ACCESS_TOKEN, after_send=after_send) + @app.route('/webhook', methods=['POST']) def webhook(): page.handle_webhook(request.get_data(as_text=True), @@ -83,6 +91,9 @@ def message_handler(event): message = event['message'] page.send(sender_id, "thank you! your message is '%s'" % message) + +def after_send(payload, response): + print("complete") ``` # Send a message From 5b46fcbe10c09a4f8a170dd6ab35db892e13b7e0 Mon Sep 17 00:00:00 2001 From: karl Date: Thu, 25 Aug 2016 17:45:23 +0900 Subject: [PATCH 08/15] Fix failed tests --- tests/test_page.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_page.py b/tests/test_page.py index 5ccdf47..e47ee54 100644 --- a/tests/test_page.py +++ b/tests/test_page.py @@ -14,14 +14,14 @@ def setUp(self): self.page._fetch_page_info = mock.MagicMock() def test_send(self): - self.page.send(12345, "hello world", quick_replies=[{'title': 'Yes', 'payload': 'YES'}]) + self.page.send(12345, "hello world", quick_replies=[{'title': 'Yes', 'payload': 'YES'}], callback=1) self.page._send.assert_called_once_with('{"message": {"attachment": null, "metadata": null, ' '"quick_replies": ' '[{"content_type": "text", "payload": "YES", "title": "Yes"}], ' '"text": "hello world"},' ' "notification_type": null, ' '"recipient": {"id": 12345, "phone_number": null}, ' - '"sender_action": null}') + '"sender_action": null}', callback=1) def test_typingon(self): self.page.typing_on(1004) From 2ea9007a4e51447d3f27543bd4d00f7924f7f53e Mon Sep 17 00:00:00 2001 From: karl Date: Thu, 25 Aug 2016 18:13:24 +0900 Subject: [PATCH 09/15] Fix bug, trigger handle_message on is_echo event --- fbmq/__init__.py | 2 +- fbmq/fbmq.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fbmq/__init__.py b/fbmq/__init__.py index e14dc35..1895042 100644 --- a/fbmq/__init__.py +++ b/fbmq/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.7.0b2' +__version__ = '1.7.0b3' from .fbmq import QuickReply, Page from . import attachment as Attachment diff --git a/fbmq/fbmq.py b/fbmq/fbmq.py index 0aa9ae6..f2be144 100644 --- a/fbmq/fbmq.py +++ b/fbmq/fbmq.py @@ -48,9 +48,10 @@ def handle_webhook(self, payload, optin=None, message=None, echo=None, delivery= elif 'message' in event: if event.get("message", {}).get("is_echo"): self._call_handler('echo', echo, event) - elif self.is_quick_reply(event) and self.has_quick_reply_callback(event): - self.call_quick_reply_callback(event) - self._call_handler('message', message, event) + else: + if self.is_quick_reply(event) and self.has_quick_reply_callback(event): + self.call_quick_reply_callback(event) + self._call_handler('message', message, event) elif 'delivery' in event: self._call_handler('delivery', delivery, event) elif 'postback' in event: From f344ebe4e2a7282dad6d07eec95b328bd1c91315 Mon Sep 17 00:00:00 2001 From: karl Date: Thu, 25 Aug 2016 19:04:42 +0900 Subject: [PATCH 10/15] Modify handler and callback calling order. before callback -> handler after handler -> callback --- fbmq/__init__.py | 2 +- fbmq/fbmq.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fbmq/__init__.py b/fbmq/__init__.py index 1895042..f096098 100644 --- a/fbmq/__init__.py +++ b/fbmq/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.7.0b3' +__version__ = '1.7.0b4' from .fbmq import QuickReply, Page from . import attachment as Attachment diff --git a/fbmq/fbmq.py b/fbmq/fbmq.py index f2be144..6abfdbd 100644 --- a/fbmq/fbmq.py +++ b/fbmq/fbmq.py @@ -49,15 +49,15 @@ def handle_webhook(self, payload, optin=None, message=None, echo=None, delivery= if event.get("message", {}).get("is_echo"): self._call_handler('echo', echo, event) else: + self._call_handler('message', message, event) if self.is_quick_reply(event) and self.has_quick_reply_callback(event): self.call_quick_reply_callback(event) - self._call_handler('message', message, event) elif 'delivery' in event: self._call_handler('delivery', delivery, event) elif 'postback' in event: + self._call_handler('postback', postback, event) if self.has_postback_callback(event): self.call_postback_callback(event) - self._call_handler('postback', postback, event) elif 'read' in event: self._call_handler('read', read, event) elif 'account_linking' in event: From fc08dfeee9a07ef9aacae7f5e4bfc05ea8153aa5 Mon Sep 17 00:00:00 2001 From: karl Date: Fri, 26 Aug 2016 12:07:53 +0900 Subject: [PATCH 11/15] #4, support notification type --- CHANGELOG | 1 + example/messenger.py | 4 ++-- fbmq/__init__.py | 4 ++-- fbmq/fbmq.py | 25 ++++++++++++++++++++----- fbmq/payload.py | 7 ++++++- 5 files changed, 31 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1ef54a3..8a82831 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,7 @@ Latest * Fix, trigger message_handler, postback_handler even if custom callbacks are used * Feature : Add a callback function in page.send * Feature : Add a page option 'after_send' (support decorator @page.after_send) +* Feature : Support notification type (e.g page.send(notification_type=NotificationType.SILENT_PUSH)) 1.6.0 ----- diff --git a/example/messenger.py b/example/messenger.py index bead16c..5e6d8e6 100644 --- a/example/messenger.py +++ b/example/messenger.py @@ -1,6 +1,6 @@ import json from config import CONFIG -from fbmq import Attachment, Template, QuickReply +from fbmq import Attachment, Template, QuickReply, NotificationType from fbpage import page USER_SEQ = {} @@ -136,7 +136,7 @@ def send_message(recipient_id, text): if text in special_keywords: special_keywords[text](recipient_id) else: - page.send(recipient_id, text, callback=send_text_callback) + page.send(recipient_id, text, callback=send_text_callback, notification_type=NotificationType.REGULAR) def send_text_callback(payload, response): diff --git a/fbmq/__init__.py b/fbmq/__init__.py index f096098..25a884e 100644 --- a/fbmq/__init__.py +++ b/fbmq/__init__.py @@ -1,5 +1,5 @@ -__version__ = '1.7.0b4' +__version__ = '1.7.0b5' -from .fbmq import QuickReply, Page +from .fbmq import * from . import attachment as Attachment from . import template as Template \ No newline at end of file diff --git a/fbmq/fbmq.py b/fbmq/fbmq.py index 6abfdbd..b73330e 100644 --- a/fbmq/fbmq.py +++ b/fbmq/fbmq.py @@ -5,6 +5,19 @@ from .payload import * +# I agree with him : http://stackoverflow.com/a/36937/3843242 +class NotificationType: + REGULAR = 'REGULAR' + SILENT_PUSH = 'SILENT_PUSH' + NO_PUSH = 'NO_PUSH' + + +class SenderAction: + TYPING_ON='typing_on' + TYPING_OFF='typing_off' + MARK_SEEN='mark_seen' + + class Page(object): def __init__(self, page_access_token, **options): self.page_access_token = page_access_token @@ -113,7 +126,8 @@ def _send(self, payload, callback=None): if callback is not None: callback(payload=payload, response=r) - def send(self, recipient_id, message, quick_replies=None, metadata=None, callback=None): + def send(self, recipient_id, message, quick_replies=None, metadata=None, + notification_type=None, callback=None): text = message if isinstance(message, str) else None attachment = message if not isinstance(message, str) else None @@ -121,25 +135,26 @@ def send(self, recipient_id, message, quick_replies=None, metadata=None, callbac message=Message(text=text, attachment=attachment, quick_replies=quick_replies, - metadata=metadata)) + metadata=metadata), + notification_type=notification_type) self._send(payload, callback=callback) def typing_on(self, recipient_id): payload = Payload(recipient=Recipient(id=recipient_id), - sender_action='typing_on') + sender_action=SenderAction.TYPING_ON) self._send(payload) def typing_off(self, recipient_id): payload = Payload(recipient=Recipient(id=recipient_id), - sender_action='typing_off') + sender_action=SenderAction.TYPING_OFF) self._send(payload) def mark_seen(self, recipient_id): payload = Payload(recipient=Recipient(id=recipient_id), - sender_action='mark_seen') + sender_action=SenderAction.MARK_SEEN) self._send(payload) diff --git a/fbmq/payload.py b/fbmq/payload.py index b8cf70c..f565416 100644 --- a/fbmq/payload.py +++ b/fbmq/payload.py @@ -6,9 +6,14 @@ def __init__(self, recipient, message=None, sender_action=None, notification_typ self.recipient = recipient self.message = message if sender_action is not None and sender_action not in ['typing_off', 'typing_on', 'mark_seen']: - raise ValueError('invalud sender_action') + raise ValueError('invalid sender_action : it must be one of "typing_off","typing_on","mark_seen"') self.sender_action = sender_action + + if notification_type is not None \ + and notification_type not in ['REGULAR', 'SILENT_PUSH', 'NO_PUSH']: + raise ValueError('invalid notification_type : it must be one of "REGULAR","SILENT_PUSH","NO_PUSH"') + self.notification_type = notification_type def to_json(self): From 86d448fee0a156a200de3aed4ed2fe6cfbd2e1d8 Mon Sep 17 00:00:00 2001 From: Karl Woojung Kim Date: Fri, 26 Aug 2016 12:15:26 +0900 Subject: [PATCH 12/15] Update README.md --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d565066..dc078f6 100644 --- a/README.md +++ b/README.md @@ -256,7 +256,7 @@ page.send(recipient_id, Template.Generic([ adjustment = Template.ReceiptAdjustment(name="New Customer Discount", amount=-50) - fbpage.send(recipient_id, Template.Receipt(recipient_name='Peter Chang', + page.send(recipient_id, Template.Receipt(recipient_name='Peter Chang', order_number='1234', currency='USD', payment_method='Visa 1234', @@ -266,8 +266,24 @@ page.send(recipient_id, Template.Generic([ summary=summary, adjustments=[adjustment])) ``` +### Options +##### notification_type +support notification_type as a option +`NotificationType.REGULAR(default)`, `NotificationType.SILENT_PUSH`, `NotificationType.NO_PUSH` + +``` +page.send(recipient_id, 'hello', NotificationType.NO_PUSH) +``` +##### callback +you can set a callback function to each `page.send` +``` +def callback(payload, response): + print('response : ' + response.text) + +page.send(recipient_id, 'hello', callback=callback) +``` # Example From 97a89e58c233a162331eb533f8731c7da262693c Mon Sep 17 00:00:00 2001 From: Karl Woojung Kim Date: Fri, 26 Aug 2016 12:16:44 +0900 Subject: [PATCH 13/15] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dc078f6..51b6b54 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,9 @@ Facebook messenger platform api full features are supported * [button callback](#button-callback) * [generic](#template--generic) * [receipt](#template--receipt) + * [options](#options) + * [notification type](#notification-type) + * [callback](#callback) * [Example](#example) @@ -268,7 +271,7 @@ page.send(recipient_id, Template.Generic([ ``` ### Options -##### notification_type +##### notification type support notification_type as a option `NotificationType.REGULAR(default)`, `NotificationType.SILENT_PUSH`, `NotificationType.NO_PUSH` From 398899e1b7e9b18235ed05270849a24cf9319580 Mon Sep 17 00:00:00 2001 From: Karl Woojung Kim Date: Fri, 26 Aug 2016 12:18:04 +0900 Subject: [PATCH 14/15] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 51b6b54..5933b13 100644 --- a/README.md +++ b/README.md @@ -274,10 +274,10 @@ page.send(recipient_id, Template.Generic([ ##### notification type support notification_type as a option -`NotificationType.REGULAR(default)`, `NotificationType.SILENT_PUSH`, `NotificationType.NO_PUSH` +`NotificationType.REGULAR (default)`, `NotificationType.SILENT_PUSH`, `NotificationType.NO_PUSH` ``` -page.send(recipient_id, 'hello', NotificationType.NO_PUSH) +page.send(recipient_id, 'hello', notification_type=NotificationType.NO_PUSH) ``` ##### callback you can set a callback function to each `page.send` From 649d6ae58ac056bfb91557a02e3ad19f3c5f54c1 Mon Sep 17 00:00:00 2001 From: karl Date: Fri, 26 Aug 2016 12:40:55 +0900 Subject: [PATCH 15/15] 1.7.0 release --- fbmq/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbmq/__init__.py b/fbmq/__init__.py index 25a884e..9d9fd2d 100644 --- a/fbmq/__init__.py +++ b/fbmq/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.7.0b5' +__version__ = '1.7.0' from .fbmq import * from . import attachment as Attachment