Closed deiong closed 7 years ago
APP/0Fatal TypeError: message.watsonData.output.text.join is not a functionFeb 13, 2017 8:49:13 AM
APP/0 at /home/vcap/app/node_modules/botkit/lib/CoreBot.js:866:32Feb 13, 2017 8:49:13 AM
APP/0 at Object.Botkit.botkit.trigger (/home/vcap/app/node_modules/botkit/lib/CoreBot.js:779:49)Feb 13, 2017 8:49:13 AM
APP/0 at Object.<anonymous> (/home/vcap/app/node_modules/botkit/lib/CoreBot.js:753:28)Feb 13, 2017 8:49:13 AM
APP/0 at /home/vcap/app/node_modules/botkit/node_modules/ware/node_modules/wrap-fn/index.js:121:18Feb 13, 2017 8:49:13 AM
APP/0 at next (/home/vcap/app/node_modules/botkit/node_modules/ware/lib/index.js:82:27)Feb 13, 2017 8:49:13 AM
APP/0 at /home/vcap/app/node_modules/botkit/lib/CoreBot.js:862:21Feb 13, 2017 8:49:13 AM
APP/0 at /home/vcap/app/node_modules/botkit-middleware-watson/lib/middleware/index.js:154:9Feb 13, 2017 8:49:13 AM
APP/0 at Promise._settlePromise (/home/vcap/app/node_modules/botkit-middleware-watson/node_modules/bluebird/js/release/promise.js:580:21)Feb 13, 2017 8:49:13 AM
APP/0 at Promise._settlePromises (/home/vcap/app/node_modules/botkit-middleware-watson/node_modules/bluebird/js/release/promise.js:691:18)Feb 13, 2017 8:49:13 AM
APP/0 at Promise._settlePromise0 (/home/vcap/app/node_modules/botkit-middleware-watson/node_modules/bluebird/js/release/promise.js:612:10)Feb 13, 2017 8:49:13 AM
APP/0 at Promise._settlePromiseFromHandler (/home/vcap/app/node_modules/botkit-middleware-watson/node_modules/bluebird/js/release/promise.js:510:31)Feb 13, 2017 8:49:13 AM
APP/0 at Object.<anonymous> (/home/vcap/app/bot-facebook.js:120:55)Feb 13, 2017 8:49:13 AM
APP/0 at Promise._fulfill (/home/vcap/app/node_modules/botkit-middleware-watson/node_modules/bluebird/js/release/promise.js:636:18)Feb 13, 2017 8:49:13 AM
APP/0 at tryCatcher (/home/vcap/app/node_modules/botkit-middleware-watson/node_modules/bluebird/js/release/util.js:16:23)Feb 13, 2017 8:49:13 AM
APP/0 at Object.bot.findConversation (/home/vcap/app/node_modules/botkit/lib/Facebook.js:103:13)Feb 13, 2017 8:49:13 AM
APP/0npm ERR! argv "/home/vcap/app/vendor/node/bin/node" "/home/vcap/app/vendor/node/bin/npm" "start"Feb 13, 2017 8:49:13 AM
APP/0npm ERR! Linux 4.4.0-45-genericFeb 13, 2017 8:49:13 AM
APP/0npm ERR! botkit-middleware-watson-multi-bot-example@0.0.1 start: `node server.js`Feb 13, 2017 8:49:13 AM
APP/0npm ERR! node v4.7.2Feb 13, 2017 8:49:13 AM
APP/0npm ERR! code ELIFECYCLEFeb 13, 2017 8:49:13 AM
APP/0npm ERR! Exit status 2Feb 13, 2017 8:49:13 AM
APP/0npm ERR! Feb 13, 2017 8:49:13 AM
APP/0npm ERR! This is most likely a problem with the botkit-middleware-watson-multi-bot-example package,Feb 13, 2017 8:49:13 AM
APP/0npm ERR! npm v2.15.11Feb 13, 2017 8:49:13 AM
APP/0npm ERR! node server.jsFeb 13, 2017 8:49:13 AM
APP/0npm ERR! Tell the author that this fails on your system:Feb 13, 2017 8:49:13 AM
APP/0npm ERR! npm owner ls botkit-middleware-watson-multi-bot-exampleFeb 13, 2017 8:49:13 AM
APP/0npm ERR! not with npm itself.Feb 13, 2017 8:49:13 AM
APP/0npm ERR! npm bugs botkit-middleware-watson-multi-bot-exampleFeb 13, 2017 8:49:13 AM
APP/0npm ERR! There is likely additional logging output above.Feb 13, 2017 8:49:13 AM
APP/0npm ERR! Or if that isn't available, you can get their info via:Feb 13, 2017 8:49:13 AM
APP/0npm ERR! Feb 13, 2017 8:49:13 AM
APP/0npm ERR! Please include the following file with any support request:Feb 13, 2017 8:49:13 AM
APP/0npm ERR! /home/vcap/app/npm-debug.log
Hi,
The output must adhere to the format of Conversation Service's output, which is a list of Strings.
Also, unless you change the middleware.interpret
's callback function, you don't have to change the output yourself. You just have to call the callback function given as a parameter in the after
function with the Conversation response object (callback(null,response)
).
Let me know if you have more questions, Steven
hi, i am trying to figure out how to overwrite the output in middleware.after = function(message, conversationResponse, callback)
i tried to modify the last line to
conversationResponse.output.text = 'This is my custom output line';
however I'm guessing its read only as this causes it to crash. in previous lines i use conversationResponse.output.text to obtain what the bot will say so i know its valid. it just won't let me overwrite it.
we plan on using a database to get custom responses. however I'm stuck trying to figure out how to overwrite the default output.
any help is appreciated.
thanks Dion