You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 21, 2024. It is now read-only.
Hello!
I've been trying to integrate this with the web template for botkit. I couldn't find any examples for it, there are only examples for facebook and slack.
Just to get it to work, my current basic code involves just bot.js and not the features directory.
Please take a look as this doesn't seem to work! More examples for web integration would also be a blessing.
const{ Botkit }=require('botkit');const{ BotkitCMSHelper }=require('botkit-plugin-cms');//Import dialogflow middlewareconstdialogflowMiddleware=require('botkit-middleware-dialogflow')({keyFilename: 'keys/testaction-service-key.json',// service account private key file from Google Cloud Console});// Import a platform-specific adapter for web.const{ WebAdapter }=require('botbuilder-adapter-web');const{ MongoDbStorage }=require('botbuilder-storage-mongodb');constpath=require('path');// Load process.env values from .env filerequire('dotenv').config();letstorage=null;if(process.env.MONGO_URI){storage=mongoStorage=newMongoDbStorage({url: process.env.MONGO_URI,});}constadapter=newWebAdapter({});constcontroller=newBotkit({debug: true,webhook_uri: '/api/messages',adapter: adapter,
storage
});// if (process.env.cms_uri) {// controller.usePlugin(new BotkitCMSHelper({// cms_uri: process.env.cms_uri,// token: process.env.cms_token,// }));// }controller.middleware.receive.use(dialogflowMiddleware.receive);controller.hears(['Default Welcome Intent'],'message,direct_message,message_received',dialogflowMiddleware.hears,function(bot,message){replyText=message.fulfillment.text;// message object has new fields added by Dialogflowconsole.log(replyText,typeofreplyText);bot.reply(message,replyText);});// make public/index.html available as localhost/index.html// by making the /public folder a static/public assetcontroller.publicFolder('/',path.join(__dirname,'.','public'));console.log('Chat with me: http://localhost:'+(process.env.PORT||3000));
The text was updated successfully, but these errors were encountered:
Hello!
I've been trying to integrate this with the web template for botkit. I couldn't find any examples for it, there are only examples for facebook and slack.
Just to get it to work, my current basic code involves just
bot.js
and not thefeatures
directory.Please take a look as this doesn't seem to work! More examples for web integration would also be a blessing.
The text was updated successfully, but these errors were encountered: