davidchua / pymessenger

A Python Wrapper for the FB Messenger Bot API (Send/Receive API)
MIT License
459 stars 183 forks source link

How to use send_button_message? #67

Open sajalkatare opened 5 years ago

sajalkatare commented 5 years ago

How I can use send_button_message function, can you please provide an example:

cqvu commented 5 years ago

The format for different button types can be found here: https://developers.facebook.com/docs/messenger-platform/send-messages/buttons/

Here's an example of how I used the URL button:

url_button = [
                {
                  "type": "web_url",
                  "url": [INSERT URL HERE],
                  "title": [DISPLAY TEXT FOR BUTTON],
                }
]

bot.send_button_message(sender_id, "message to send with button", url_button)