@broid/kit-botpress
v0.1.0
Published
Broid Kit Middleware for Botpress.
Downloads
3
Readme
Broid Kit Botpress
Broid Kit Botpress is a broid-kit middlewares that integrates botpress with Broid Integrations which allows you to leverage the largest collection of messaging channels integrated in a single framework.
This middleware support Incoming
and Outcoming
messages.
Connect your application to multiple messaging channels using W3C Open standards.
Quick Example
const path = require("path");
const Bot = require("@broid/kit");
const BroidDiscord = require("@broid/kit-botpress");
const BroidMessenger = require("@broid/messenger");
const BroidSlack = require("@broid/slack");
const bot = new Bot({
logLevel: "info",
http: {
host: "0.0.0.0",
port: 8080,
}
});
bot.use(new BroidSlack(<...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 message
bot.sendText("Hi, How are you?", data.raw);
});
Documentation
Quick Start
- 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 ;)
- Install broid-kit
$ cd .. && npm i --save @broid/kit
- Install all the broid integrations you need. You can see the full list here
$ 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!
const path = require("path");
const Bot = require("@broid/kit");
const BroidSLack = require("@broid/slack");
const BroidDiscord = require("@broid/kit-botpress");
const BroidMessenger = require("@broid/messenger");
const BroidKitBotpress = require("@broid/kit-botpress");
const bot = new Bot({
logLevel: "info",
http: {
host: "0.0.0.0",
port: 8080,
}
});
bot.use(new BroidSlack(<...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);
});