davidchua / pymessenger

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

quick reply buttons #45

Open iamnottheway opened 7 years ago

iamnottheway commented 7 years ago

Added quick reply to pymessenger. Creating and passing a payload is not needed to display quick reply buttons. Just passing a tuple containing the button_text and payload text will create the buttons. Now, any number of buttons can be added in quick replies. I've tested it on my bot, works well. Please test it and let me know if it has any problems.

the format for creating reply_options: options = ( ["button1","payload1"], ["button2","payload2"], ) example:


from pymessenger.bot import Bot
bot = Bot(<access_token>)
reply_message = "Choose any number"
reply_options = (["one","@one"],["two","@two"])
bot.send_quickreply(recipient_id,reply_message,reply_options)

Thanks!