notice
This is documentation for Rasa Documentation v2.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.x).
rasa.core.channels.facebook
Messenger Objects
Implement a fbmessenger to parse incoming webhooks and send msgs.
message
Handle an incoming event from the fb webhook.
postback
Handle a postback (e.g. quick reply button).
MessengerBot Objects
A bot that uses fb-messenger to communicate.
send
Sends a message to the recipient using the messenger client.
send_text_message
Send a message through this channel.
send_image_url
Sends an image. Default will just post the url as a string.
send_action
Sends a sender action to facebook (e.g. "typing_on").
Arguments:
recipient_id
- recipientsender_action
- action to send, e.g. "typing_on" or "mark_seen"
send_text_with_buttons
Sends buttons to the output.
send_quick_replies
Sends quick replies to the output.
send_elements
Sends elements to the output.
send_custom_json
Sends custom json data to the output.
FacebookInput Objects
Facebook input channel implementation. Based on the HTTPInputChannel.
__init__
Create a facebook input channel.
Needs a couple of settings to properly authenticate and validate messages. Details to setup:
https://github.com/rehabstudio/fbmessenger#facebook-app-setup
Arguments:
fb_verify
- FB Verification string (can be chosen by yourself on webhook creation)fb_secret
- facebook application secretfb_access_token
- access token to post in the name of the FB page
validate_hub_signature
Make sure the incoming webhook requests are properly signed.
Arguments:
app_secret
- Secret Key for applicationrequest_payload
- request bodyhub_signature_header
- X-Hub-Signature header sent with request
Returns:
bool
- indicated that hub signature is validated