I just installed the Yeoman generator for botkit and created a new bot with the web adapter template. I get an error when running it using npm start.
[...]/botkit-weberror/features/typing.js:7
let typing = new BotkitConversation('typing', controller);
^
ReferenceError: BotkitConversation is not defined
Follow the steps on https://botkit.ai/getstarted.html
npm install -g yo generator-botkityo botkitnpm start
I would expect the bot to start and run correctly.
When I delete the file features/typing.js, the project starts.
You should add this to your features/typing.js
const { BotkitConversation } = require("botkit");
Thank you for the bug report. I will issue an update to the generator ASAP.
Thanks gentlemen the quick reply.
@valentinkauth ; the fix you suggested works.
I just started looking into botkit; the framework looks amazing.
Thanks, @etiennellipse! Lots of people have helped to make it what it is!
Just pushed 4.5.1 of the generator. Thanks again for the report!
I still keep getting the same error actually:
/**
module.exports = function(controller) {
/**
* Detect when a message has a sticker attached
*/
controller.hears(['buenas noches','buenas tardes','buen dia','hola','como estas','que haces','permiso'], 'message', async function(bot, message) {
var recruit_id = 'recruit_conversation';
var recruit_convo = new BotkitConversation(recruit_id,controller);
recruit_convo.say('Hola! Bienvenido al servicio de reclutamiento');
recruit_convo.say('Te vamos a hacer las siguientes preguntas para conformar tu perfil en nuestro sistema.');
recruit_convo.ask(' tuviste entrevista previa con nosotros?');
});
}
Most helpful comment
You should add this to your
features/typing.jsconst { BotkitConversation } = require("botkit");