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

Added the ability to send payload directly to Messenger #85

Open
wants to merge 2 commits 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
12 changes: 12 additions & 0 deletions pymessenger/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ def send_button_message(self, recipient_id, text, buttons, notification_type=Not
}
}, notification_type)

def send_custom_message(self, recipient_id, payload, notification_type=NotificationType.regular):
"""This allows users send custom data to the Messenger API.
This is best for cases where Messenger releases new features
And the PyMessenger team hasn't specifically implemented that feature
Input:
recipient_id: recipient id to send to
payload: dictionary containing raw request payload (requested by Messenger)
Output:
Response from API as <dict>
"""
return self.send_message(recipient_id, payload, 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