fbbotw.post_text_w_quickreplies

fbbotw.post_text_w_quickreplies(fbid, message, quick_replies, messaging_type=’RESPONSE’, tag=None)[source]

Send text with quick replies buttons

Usage:
>>> # Set the user id and the message to send
>>> fbid = "<user page scoped id>"
>>> message = "Hi! Do you want to know today's forecast?"
>>> # Set the quick replies list to be sent
>>> quick_replies = [
        {
            "content_type": "text",
            "title": "Yes!",
            "payload": "SEND_FORECAST"
        },
        {
            "content_type": "text",
            "title": "Nope",
            "payload": "USER_SAY_NOT"
        }
    ]
>>> # Send the message with the quick_replies
>>> response = fbbotw.post_text_w_quickreplies(
        fbid=fbid,
        message=message,
        quick_replies=quick_replies
    )
Parameters:
  • fbid (str) – User id to send the quick replies menu.
  • message (str) – message to be displayed with the quick replies.
  • quick_replies (list) –

    (Max 11) format :

    >>> quick_replies = [
        {
            “content_type”: “text”,
            “title”: “Yes!”,
            “payload”: “USER_SAY_YES”
        },
        {
            “content_type”: “text”,
            “title”: “Nope”,
            “payload”: “USER_SAY_NOT”
        },
        {
            “content_type”: “location”,
        },
        {
            “content_type”: “text”,
            “title”: “Red”,
            “payload”: “DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED”,
            “image_url”: “http://petersfantastichats.com/img/red.png”
        },
    ]
    >>> # See all the fields for the quick reply object in the docs:
    >>> # /docs/messenger-platform/send-api-reference/quick-replies
    
  • messaging_type (str) – Identifies the message type from: RESPONSE, UPDATE AND MESSAGE_TAG (Default: RESPONSE, if MESSAGE_TAG, tag param is required)
  • tag (str) – Tag classifying the message, must be one of the following tags
Returns:

Response object

Facebook docs:

/quick-replies