Skip to content

Commit

Permalink
- fixed quick replies to be considered as postbacks and not regular m…
Browse files Browse the repository at this point in the history
…essages
  • Loading branch information
miki2826 committed Jul 10, 2016
1 parent b6fd282 commit 875d5b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ botly.on("error", (ex) => {

### Change Log

#### version 1.0.1
- quick replies are considered as postback and not regular message

#### version 1.0.0
- removed `createTemplate` function - was too verbose
- moved to object parameters - too many parameters
Expand Down
6 changes: 3 additions & 3 deletions lib/Botly.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,15 @@ function _handleDelivery(message) {
}

function _handlePostback(message) {
if (message.postback) {
let postback = message.postback.payload;
if (message.postback || (message.message && message.message.quick_reply)) {
let postback = (message.postback &&message.postback.payload) || message.message.quick_reply.payload;
this.emit('postback', message.sender.id, message, postback);
}
}

function _handleUserMessage(message) {
var value;
if (message.message && message.message.text) {
if (message.message && message.message.text && !message.message.quick_reply) {
value = {text: message.message.text};
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "botly",
"version": "1.0.0",
"version": "1.0.1",
"description": "Simple Facebook Messenger Bot API",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 875d5b5

Please sign in to comment.