Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Fix compatibility with node-wit 5 #26

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
field clear
mabuonomo committed Feb 23, 2019
commit 17fb5add3929c8dfa364f418c9408c17beabc9b7
4 changes: 1 addition & 3 deletions src/botkit-middleware-witai.js
Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@ module.exports = function (config) {

client.message(message.text, {})
.then((data) => {
console.log('Yay, got Wit.ai response: ' + JSON.stringify(data));
message.entities = data.entities;
next();
}).catch((error) => {
@@ -54,9 +53,8 @@ module.exports = function (config) {
let key = keys.shift();
let entity = message.entities[key].shift();
let confidence = entity.confidence;
let value = entity.value;

if (tests.find((value, index, array) => value == key) &&
if (tests.find((value) => value == key) &&
confidence >= config.minimum_confidence) {
return true;
}