Hey,
I am trying to get botkit-cms working locally within a botkit app. I think this would be ideal for a production deployment, not having to rely on another server to be up.
I am using
"botkit": "^4.0.2",
"botkit-cms": "0.0.4",
"botkit-plugin-cms": "^1.0.1",
When I follow the directions and include:
var cms = require('botkit-cms')();
cms.useLocalStudio(controller);
cms.loadScriptsFromFile(__dirname + '/scripts.json').catch(function(err) {
console.error('Error loading scripts', err);
});
I get the following error: TypeError: Cannot set property 'evaluateTrigger' of undefined.
I fixed here this by changing the controller.studio references to be controller.plugins.cms. This seems to fix the problem and things seem to more or less work. The bot responds to the triggers that are setup.
However, there is an exception when the input is something that doesn't cause any triggers to be returned.
Error in trigger handler undefined
(node:53014) UnhandledPromiseRejectionWarning: Error:
at Botkit.<anonymous> (blah/blah/node_modules/botkit/src/core.ts:1036:27)
Thanks for any help or direction on how to continue looking into this.