All Projects → broidHQ → Broid Kit

broidHQ / Broid Kit

Licence: other
Bot framework powered by Broid

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Broid Kit

Integrations
Connect your App to Multiple Messaging Channels with the W3C Open standard.
Stars: ✭ 721 (+1143.1%)
Mutual labels:  bot, skype, twilio, slack, messaging, messenger, twitter
Bottender
⚡️ A framework for building conversational user interfaces.
Stars: ✭ 3,803 (+6456.9%)
Mutual labels:  bot, framework, slack, messaging, messenger
Messenger
Package messenger is used for making bots for use with Facebook messenger
Stars: ✭ 278 (+379.31%)
Mutual labels:  api, bot, framework, messenger
Messenger4j
A Java library for building Chatbots on the Facebook Messenger Platform - easy and fast.
Stars: ✭ 199 (+243.1%)
Mutual labels:  api, bot, framework, messenger
Messaging Apis
Messaging APIs for multi-platform
Stars: ✭ 1,754 (+2924.14%)
Mutual labels:  bot, slack, messaging, messenger
Notify
A dead simple Go library for sending notifications to various messaging services.
Stars: ✭ 727 (+1153.45%)
Mutual labels:  bot, slack, messaging, twitter
Wechat Go
go version wechat web api and message framework for building wechat robot
Stars: ✭ 1,381 (+2281.03%)
Mutual labels:  api, bot, framework
Slack Starterbot
Python-powered simple starter Slack bot.
Stars: ✭ 169 (+191.38%)
Mutual labels:  api, bot, slack
Node Fb Messenger
✉️ Facebook Messenger Platform Node.js API Wrapper
Stars: ✭ 206 (+255.17%)
Mutual labels:  api, bot, messenger
messaging-apis
Messaging APIs for multi-platform
Stars: ✭ 1,759 (+2932.76%)
Mutual labels:  slack, messaging, messenger
Tradingview Webhook Bot
⚙️ Send TradingView alerts to Telegram, Discord, Slack, Twitter and/or Email.
Stars: ✭ 135 (+132.76%)
Mutual labels:  bot, slack, twitter
Twitch Js
A community-centric, community-supported version of tmi.js
Stars: ✭ 225 (+287.93%)
Mutual labels:  api, bot, messaging
The Seo Framework
The SEO Framework WordPress plugin.
Stars: ✭ 329 (+467.24%)
Mutual labels:  api, framework, twitter
Wa Automate Nodejs
💬 🤖 The most advanced NodeJS WhatsApp library for chatbots with advanced features. Be sure to 🌟 this repository for updates!
Stars: ✭ 1,326 (+2186.21%)
Mutual labels:  api, bot, framework
Slacko
A neat interface for Slack
Stars: ✭ 64 (+10.34%)
Mutual labels:  api, bot, slack
Magento Chatbot
Magento Chatbot Integration with Telegram, Messenger, Whatsapp, WeChat, Skype and wit.ai.
Stars: ✭ 149 (+156.9%)
Mutual labels:  bot, skype, messenger
Botkit
Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
Stars: ✭ 10,555 (+18098.28%)
Mutual labels:  bot, twilio, slack
Franz
Franz is a free messaging app for services like WhatsApp, Slack, Messenger and many more.
Stars: ✭ 4,088 (+6948.28%)
Mutual labels:  slack, messaging, messenger
Wdt Emoji Bundle
Slack like emoji picker with apple/ios, twitter/twemoji, google, emojione, facebook, messenger emoji support
Stars: ✭ 411 (+608.62%)
Mutual labels:  slack, messenger, twitter
Pymessager
Python API to develop chatbot on Facebook Messenger Platform
Stars: ✭ 580 (+900%)
Mutual labels:  api, bot, messenger

npm node bithound bithoundscore nsp-checked

Broid Kit

Broid Kit aims to ease the creation of bots communicating through messaging platforms. Broid Kit is powered by Broid Integrations which allows you to leverage the largest collection of messaging channels integrated in a given framework.

Connect your App to Multiple Messaging Channels with the W3C Open standards.


Broid.ai



gitter join-slack

Quick Example

Note: Options for the integration examples can be found on the Discord, Messenger, and Slack documentation respectively.

const Bot = require("@broid/kit");
const BroidDiscord = require("@broid/discord");
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 BroidDiscord({...options}));
bot.use(new BroidMessenger({...options}));
bot.use(new BroidSlack({...options}));

// Listening for public starting by regex match for `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.message);
  });

Broid-Kit can also be used with your existing Express setup.

const Bot = require("@broid/kit");
const BroidDiscord = require("@broid/discord");
const BroidMessenger = require("@broid/messenger");
const BroidSlack = require("@broid/slack");
const express = require("express");

const bot = new Bot({
  logLevel: "info"
});

bot.use(new BroidDiscord({...options}));
bot.use(new BroidMessenger({...options}));
bot.use(new BroidSlack({...options}));

// Setup express
const app = express();
app.use("/", bot.getRouter());
app.listen(8080);

// Listening for public starting by regex match for `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.message);
  });

Documentation

Receive all group messages

bot.on("Group")
  .subscribe((data) => {
    console.log("Data:", JSON.stringify(data, null, 2));

    // Reply to the message
    bot.sendText("i am listening all messages", data.message);
  });

Receive all private messages

bot.on("Person")
  .subscribe((data) => {
    console.log("Data:", JSON.stringify(data, null, 2));

    // Reply to the message
    bot.sendText("i am listening all messages", data.message);
  });

Receive all

Because Broid Kit is built with Observables, you can subscribe to multiple sources.

const Observable = require("rxjs").Observable;

Observable.merge(bot.on("Group"), bot.on("Person"))
  .subscribe((data) => {
    console.log("Data:", JSON.stringify(data, null, 2));

    // Reply to the message
    bot.sendText("i am listening all messages", data.message);
  });

Matching patterns and keywords

bot.hears(["keyword", "hello.*"], "Group")
  .subscribe(data => {
    console.log("Data:", JSON.stringify(data, null, 2));
  });

Node callback is supported

bot.hear("hello.*", "Group", (data, error) => {
  console.log("Data:", JSON.stringify(data, null, 2));
});
bot.hears(["keyword", "hello.*"], "Group", (data, error) => {
  console.log("Data:", JSON.stringify(data, null, 2));
});

Send a simple message

bot.sendText("Hello world.", data.message);

Send a video or image message

bot.sendImage("http://url-of-media", data.message, optionalMeta);

// OR

bot.sendVideo("http://url-of-media", data.message, optionalMeta);

optionalMeta is an object of optional information for the media. It should like:

{
  "content": "description of the meta",
  "title": "title for the media"
}

Middleware

Broid kit supports middleware to allow you to preprocess received or sent messages.

Example of Middleware preprocessing

class MyMiddleware {
  constructor() {}

  serviceName() {
    return "MyMiddleware";
  }

  incoming(bot, message) {
    // the return value can be an Promise<object>, Observable<object> or null
    return "Hello world!";
  }

  outgoing(bot, message) {
    // the return value can be an Promise<object>, Observable<object> or null
    // The object.content field will be use to update the text of the message sent.
    return "Good bye world!";
  }
}

This middleware can be used like so:

bot.use(new MyMiddleware());

WebHooks

Broid Kit provide an http server and creates a default webhook route when the integration requires it. By default, the webhook path follows the naming convention: webhook/<integration>, integration is the name provide by the getServiceName method.

In case of @broid/skype the webhook route will be /webhook/skype.

Contribute

See CONTRIBUTE.md.

License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].