I am trying to build a chatbot using botkit anywhere and nodejs. I don't want to use any third-party messaging platform. I refer to this link https://github.com/howdyai/botkit#build-your-bot and try to setup chatbot in nodejs application:
First, add it to your project:
npm install --save botkit
Then, add Botkit to your application code:
var Botkit = require('botkit');
var controller = Botkit.anywhere(configuration);
controller.hears('hello','direct_message', function(bot, message) { bot.reply(message,'Hello yourself!'); });
But they don't mention how to call and where to call this code in the existing application.