diff --git a/README.md b/README.md index 710940d..f54196b 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ This wrapper has the following functions: * send_message(recipient_id, message) * send_generic_message(recipient_id, elements) * send_button_message(recipient_id, text, buttons) +* send_list_message(recipient_id, text, list_items) +* send_quick_replies(recipient_id, message, quick_replies) * send_attachment(recipient_id, attachment_type, attachment_path) * send_attachment_url(recipient_id, attachment_type, attachment_url) * send_image(recipient_id, image_path) @@ -95,7 +97,6 @@ bot.send_image_url(recipient_id, image_url) * Structured Messages * Receipt Messages -* Quick Replies * Airlines * Tests! diff --git a/pymessenger/bot.py b/pymessenger/bot.py index 5a7311c..2b1b524 100644 --- a/pymessenger/bot.py +++ b/pymessenger/bot.py @@ -159,6 +159,34 @@ def send_button_message(self, recipient_id, text, buttons, notification_type=Not } } }, notification_type) + + def send_list_message(self, recipient_id, text, list_items, + notification_type=NotificationType.regular): + + return self.send_generic_message(recipient_id, + list_items, notification_type) + + def send_quick_replies(self, recipient_id, message, quick_replies, + notification_type=NotificationType.regular): + """Send a quick reply to the specified recipient wi + th specific type of quick reply. + https://developers.facebook.com/docs/messenger-p + latform/reference/send-api/quick-replies/ + Input: + recipient_id: recipient id to send to + text: Text to ask for something + type: content_type. eg: text, location, + user_phone_number, user_email + title: Title of quick reply + payload: Postback payload + img_url: Icon URL for quick Reply suggestion + Output: + Response from API as + """ + return self.send_message(recipient_id, { + "text": message, + "quick_replies": quick_replies + }, notification_type) def send_action(self, recipient_id, action, notification_type=NotificationType.regular): """Send typing indicators or send read receipts to the specified recipient.