Comparing version 0.29.0-beta.12 to 0.29.0-beta.13
{ | ||
"name": "botnaut", | ||
"version": "0.29.0-beta.12", | ||
"version": "0.29.0-beta.13", | ||
"description": "Facebook Messenger Chatbot Framework", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,3 +29,10 @@ /* | ||
return Object.assign(replyData, { action }); | ||
const condition = reply.hasCondition | ||
? eval(reply.conditionFn) // eslint-disable-line no-eval | ||
: () => true; | ||
return Object.assign(replyData, { | ||
action, | ||
condition | ||
}); | ||
}); | ||
@@ -95,5 +102,7 @@ } | ||
if (replies) { | ||
res.text(text, replies.map(reply => Object.assign({}, reply, { | ||
title: getLanguageText(reply.title, req.state.lang) | ||
}))); | ||
res.text(text, replies | ||
.filter(reply => reply.condition(req, res)) | ||
.map(reply => Object.assign({}, reply, { | ||
title: getLanguageText(reply.title, req.state.lang) | ||
}))); | ||
} else { | ||
@@ -100,0 +109,0 @@ res.text(text); |
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
3282926
8822
34
8