This repository was archived by the owner on Mar 18, 2020. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork2
Broid Kit Middleware for Botpress.
License
NotificationsYou must be signed in to change notification settings
broidHQ/broid-kit-botpress
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Broid Kit Botpress is abroid-kit middlewares that integratesbotpress withBroid Integrations which allows you to leverage the largest collection of messaging channels integrated in a single framework.
This middleware supports onlyIncoming
messages (communication channel -> broid -> botpress),Outgoing
is not supported (there is no way to pass messages from botpress -> broid -> communication channel, the only option is broid -> communication channel).
Connect your application to multiple messaging channels using W3C Open standards.
constpath=require("path");constBot=require("@broid/kit");constBroidDiscord=require("@broid/kit-botpress");constBroidMessenger=require("@broid/messenger");constBroidSlack=require("@broid/slack");constbot=newBot({logLevel:"info",http:{host:"0.0.0.0",port:8080,}});bot.use(newBroidSlack(<...options>));bot.use(new BroidDiscord(<...options>));bot.use(new BroidMessenger(<...options>));bot.use(new BroidKitBotpress({botpressPath:path.join(__dirname,'botpress')}));// Listening for public starting by `hello`bot.hear("hello.*", "Group") .subscribe((data) =>{console.log("Data:",JSON.stringify(data,null,2));// Reply to the messagebot.sendText("Hi, How are you?",data.raw);});
- Create a new node project
$ npm init
- Install and initialize a new botpress project
$ npm -g i botpress$ mkdir botpress&&cd botpress&& botpress init
Take a coffee ;)
- Installbroid-kit
$cd ..&& npm i --save @broid/kit
- Install all the broid integrations you need. You can see the full listhere
$ npm i --save @broid/skype @broid/slack @broid/messenger @broid/discord
- Install
broid-kit-botpress
$ npm i --save @broid/kit-botpress
- Copy past the basic code and play with it!
constpath=require("path");constBot=require("@broid/kit");constBroidSLack=require("@broid/slack");constBroidDiscord=require("@broid/kit-botpress");constBroidMessenger=require("@broid/messenger");constBroidKitBotpress=require("@broid/kit-botpress");constbot=newBot({logLevel:"info",http:{host:"0.0.0.0",port:8080,}});bot.use(newBroidSlack(<...options>));bot.use(new BroidDiscord(<...options>));bot.use(new BroidMessenger(<...options>));bot.use(new BroidKitBotpress({botpressPath:path.join(__dirname,'botpress')}));bot.hear('.*', 'Person') .subscribe((data) =>{console.log("hear data",data);});