Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add quick replies buttons #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pymessenger/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,21 @@ def send_button_message(self, recipient_id, text, buttons, notification_type=Not
}
}, notification_type)

def send_quick_replies_message(self, recipient_id, text, quick_replies, notification_type=NotificationType.regular):
"""Send text messages to the specified recipient.
https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies
Input:
recipient_id: recipient id to send to
text: text of message to send
quick_replies: quick_replies to send
Output:
Response from API as <dict>
"""
return self.send_message(recipient_id, {
"text": text,
"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.
https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions
Expand Down