-
Notifications
You must be signed in to change notification settings - Fork 49
adapt to new version of wit api, give configuration option for wit co… #27
base: master
Are you sure you want to change the base?
Conversation
src/botkit-middleware-witai.js
Outdated
client.message(message.text, {}) | ||
.then((data) => { | ||
message.entities = data.entities; | ||
console.log(JSON.stringify(data)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this console.log, or use the debug module
@ALBotStageSoftNaert This looks backward compatible but I want to make sure you agree. Is it? Thanks for your quick response to my review! |
Also, it looks like the hears middleware may need a mild update? See this other PR -> #26 |
@benbrown thanks for your fast review. I think that it won't be backwards compatible, node-wit changed the way they return intents in a different way. However they do provide the posibility to provide an option to include the apiversion. https://github.com/wit-ai/node-wit#changing-the-api-version. I can add an extra config option to make it backwards compatible in this manner. |
In that case the readme will need some updates and we'll have to bump the version number on npm. Thanks! |
@benbrown I updated the discussed topics
I also noticed that the results from entities were taken instead of entities.intent. This is possible and would mean that all entities in wit can be used to get a match, not only the intents. However, I don't think this is desired behaviour, so it wasn't included in the changes.
|
I adapted the middleware to work with version 5.0.0 of node-wit. I added an optional config option so that you could specify a command to use instead of the bot identity. If no command was specified every request will be parsed by wit.