fb-messenger-bot-chat
Advanced tools
Comparing version 0.0.7 to 0.0.8
{ | ||
"name": "fb-messenger-bot-chat", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Facebook Messenger Bot Send API implementation and chat simulator", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -76,2 +76,18 @@ module.exports = (config) => { | ||
var mappedCards = cards.map(function(card) { | ||
if (_.isArray(card.buttons)) { | ||
card.buttons = card.buttons.map(function(btn) { | ||
if (_.isObject(btn.payload)) { | ||
btn.payload = JSON.stringify(btn.payload); | ||
} | ||
return btn; | ||
}); | ||
} | ||
return card; | ||
}); | ||
var message = { | ||
@@ -82,3 +98,3 @@ attachment: { | ||
template_type: "generic", | ||
elements: cards | ||
elements: mappedCards | ||
} | ||
@@ -100,3 +116,3 @@ } | ||
} | ||
if (!message || !message.sender || !message.sender.id) { return recognizedMessage; } | ||
@@ -103,0 +119,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19127
410