GithubHelp home page GithubHelp logo

botmasterai / botmaster Goto Github PK

View Code? Open in Web Editor NEW
252.0 17.0 47.0 4.34 MB

The chatbot framework for your serious projects

Home Page: http://botmasterai.com/

License: MIT License

JavaScript 100.00%
botmaster chatbot-framework nodejs messenger slack twitter

botmaster's Introduction

Botmaster

Build Status Coverage Status Dependency Status npm-version license

Botmaster v3 out.

Botmaster v3 is virtually a complete rewrite of the framework. A lot of the syntax remains the same, but there are quite a few breaking changes that were necessary in order to get the framework to where we wanted it to be. It is now truly a micro-framework. With only 2 dependencies and without relying on express anymore, Botmaster v3 is the only JS bot framework that gives as much control as possible to the developer without losing its ease of use.

A migration documentation can be found at: https://github.com/botmasterai/botmasterai.github.io/blob/master/docs/changelog.md#major-308

Botmaster is a lightweight chatbot framework. Its purpose is to integrate your existing chatbot into a variety of messaging channels - currently Facebook Messenger, Twitter DM and Telegram.

Documentation

Find the whole documentation for the framework here: https://github.com/botmasterai/botmasterai.github.io/tree/master/docs

License

This library is licensed under the MIT license

botmaster's People

Contributors

andremw avatar jdwuarin avatar jwickens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botmaster's Issues

Can not deploy to Heroku

The project works on local environment with Ngrok.
But when I deploy this project to Heroku, the project can not be started. The problem may be from fixed port botmaster.js

Sender id varies and botmaster can't handle incoming messages

I've set two instances of botmaster-messenger listening to two different pages (two different pageTokens). I then sent one message from my personal account to each of these two pages and did a simple reply(return bot.reply(update, 'Hello world');) but got this error:

StatusCodeError: 400 - {"error":{"message":"(#100) No matching user found","type":"OAuthException","code":100,"error_subcode":2018001,"fbtrace_id":"BJFnjNlYWmT"}}
I noticed in the update obj that the sender id (that should be the same, right?) varies, and I think that it may be related to the error.

The update object of the message sent to each page:

{"sender":{"id":"1562151773797420"},"recipient":{"id":"311723625925833"},"timestamp":1495198187591,"message":{"mid":"mid.$cAAEbgvNWwbFiUgcIR1cIMG_0iWpC","seq":31635,"text":"hi"},"raw":{"id":"311723625925833","time":1495198187640,"messaging":[{"sender":{"id":"1562151773797420"},"recipient":{"id":"311723625925833"},"timestamp":1495198187591,"message":{"mid":"mid.$cAAEbgvNWwbFiUgcIR1cIMG_0iWpC","seq":31635,"text":"hi"}}]}}

{"sender":{"id":"1354592824626036"},"recipient":{"id":"1335710399797960"},"timestamp":1495198190004,"message":{"mid":"mid.$cAAS-0nNMF7BiUgcRtFcIMHJREirb","seq":31638,"text":"hey"},"raw":{"id":"1335710399797960","time":1495198190087,"messaging":[{"sender":{"id":"1354592824626036"},"recipient":{"id":"1335710399797960"},"timestamp":1495198190004,"message":{"mid":"mid.$cAAS-0nNMF7BiUgcRtFcIMHJREirb","seq":31638,"text":"hey"}}]}}

The error happens only for the second bot I add, not for the first one. If I invert the order of the addBot the one that was throwing an error works and the one that was working stops working.

I googled and found some issues ([1], [2] related to it, but it seems that it should be fixed by now. It seems that the issue was that sometimes the id came as string and sometimes as number, but it's not what's happening to me..

Any idea?

Messenger settings

How can I perform following tasks with botmaster ?

  1. Set Messenger thread settings (Greeting, Get Started button, Persistent menu).
  2. Set Messenger on boarding hook.
  3. White list domains for Messenger extensions sdk.

Is there any clearly document for integrating a new chat application into this project?

I am trying to create a project for LINE chat app by implementing from BaseBot. After copy from MessengerBot and change something but I can not integrate it with botmaster. The request can not send to middleware controller. The problem maybe come from __setupServersRequestListeners() on botmaster.js:

 for (const path in this.__serverRequestListeners) {
        if (req.url.indexOf(path) === 0) {
          const requestListener = this.__serverRequestListeners[path];
          return requestListener.call(this.server, req, res);
        }
      }

If I have 2 paths: messenger/webhook and line/webhook, only the first element of __serverRequestListeners can access to the if block.

Is there any clearly document for contribute a new chat application?

Chot Bot Platform

We are lookig for open source framewrok for creating a new Cht Bot platform.

Can you guide on this, like what can be challenges in this..

  1. Hoisting diffrent instance as per Users
  2. Pusblishing on diffrent Channels (FB,Web,etc)

What are your pointer on this ? @jdwuarin, @jwickens @andremw @duncsand @yrezgui

Multiple bubbles from Watson Conversation

Hi,
When Watson should answer multiple text bubbles, only the first is displayed, but the route still progress.
Is it a bug or something ?
Thank you for your answer

Add multiple instances of Messenger Bot

Hi 👋, i'm making a project where i have to implement the same bot on multiple pages with a single Facebook app. I tried to create multiple instances of a Messenger bot like this :

const botmaster = new Botmaster();

const MessengerBot = require('botmaster-messenger');

botmaster.addBot(new MessengerBot({
  credentials: {
    verifyToken: 'TOKEN',
    pageToken: '[myPageToken1]',
    fbAppSecret: '[myAppSecret]',
  },
  webhookEndpoint: 'webhook'
}));

botmaster.addBot(new MessengerBot({
  credentials: {
    verifyToken: 'TOKEN',
    pageToken: '[myPageToken2]',
    fbAppSecret: '[myAppSecret]',
  },
  webhookEndpoint: 'webhook'
}));

botmaster.addBot(new MessengerBot({
  credentials: {
    verifyToken: 'TOKEN',
    pageToken: '[myPageToken3]',
    fbAppSecret: '[myAppSecret]',
  },
  webhookEndpoint: 'webhook'
}));

It works for one of my pages only, but when i chat by the other connected pages i've this error in the my console :

(node:62803) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Uncaught, unspecified "error" event. ([object Object])

If anyone understands this error and knows how to solve this problem, I would like to have some clarification.
Thank you for your reply

telegram bot remains inactive on node-red

I am having an issue on which i am using a telegram bot but remains inactive on node-red.
I have configured this node and filled all the details correctly and created the webhook on telegram and exposed my localhost using ngrok.

Any suggestions ?
sketch

Documentation is down

Hi,
Just realized that the botmaster documentation is not accessible as of now.

Url: http://botmasterai.com/documentation/latest
Error: ERR_EMPTY_RESPONSE

/messenger/webhook1234 not found

I'm new at this so forgive my ignorance. I set up the hello world for facebook messenger at glitch.com. I put botmaster-messenger in my package.json dependencies. But the chatbot does not respond, and when I try to directly contact https://lowly-earthquake.glitch.me/messenger/webhook1234/ I get a "cannot Get" message. Likewise with https://lowly-earthquake.glitch.me/messenger

The server is express (server.js) is there any configuration I need to do there? Do you have an idea why is it not working?

Botmaster with socketio and watson-conversation-ware

I'm developing a chatbot using masterbot, socketio, watson-conversation. The problem is that I wasn't able to understand what I need to do to recive the watson-conversation welcome message before I begin to send messages. Now I just recive messages after send some text, what I need is recive the first message before send any messager. Is it possible to have it using botmaster? Recive a message before send any text.

I also open this question here: https://stackoverflow.com/questions/49220972/botmaster-with-socketio-and-watson-conversation-ware

Thank you.

An IRC bot

I'm surprised there isn't one, or is it that integrating botmaster with another IRC package so simple that its not really worth it?

Initial messages

Hi,

is it possible to send an initial message to the new coming user when he opens the messenger on Facebook?

I know Facebook allows this as you can send some chatbot introduction at the start.

Thanks

multiple watson bots with sessionware?

Currently I'm working on a platform for a project at university.
I want to experiment with multiple chatbots talking to each other in a single chatroom.
It has no deeper practical application besides being somewhat of an art project where students are designing bot personas who will then "date" each other on a fictional platform.

My bots are made with IBM Watson and I'm using botmaster with sessionware and the watson middleware with a configuration based on socket.io. I'm able to connect to one single bot at a time but can't get multiple bots into one session / socket room. There is no information on this issue in the botmaster documentation and I'm struggling with the following part:

0: botmaster.use({
1: type: 'incoming',
2: name: 'my-awesome-middleware',
3: controller: (bot, update, next) => {
4: // watsonUpdate.output.text is an array as watson can reply with a few
5: // messages one after another
6: return bot.sendTextCascadeTo(update.watsonUpdate.output.text,update.sender.id);
7: }
8: });

Line 0: why can't I use a second middleware object named "botmaster2" in parallel or after the "botmaster" object?
Line 3: how is the parameter 'bot' transferred to the middleware (I can only trace 'update')?

How can I tell the controller to use some other "bot" parameter or, the other way around: how to identify which bot is actually used through the middleware? It all seems pretty much abbreviated and straightforward for one use case, but hides the features and information to solve my particular problem.

use debug repo for debug logging

botmaster should have debug available which can be enabled through botmaster:* namespace.

For en example see the botmaster-fulfill repo.

Multiple replies for a single DM.

I’m trying to use Botmaster (version 0.4.1) in Node-RED, but I’m getting multiple replies for each DM the account receives.

I did the Twitter configuration following the instructions from https://github.com/botmasterai/botmaster-twitter-dm and I’m using the flow available at https://flows.nodered.org/node/node-red-contrib-botmaster.

In addition to this problem, I also get the error message “TypeError: bot.removeAllListeners is not a function” in Node-RED every time I deploy the flow.

Any suggestion on how to solve these problems?

Wrong attachment example

There is a wrong example of send attachment at base_bot.js
Is is also affecting the documentation site.

  • @example
    • bot.sendAttachmentFromURLTo('image', "some image url you've got", update.sender.id);
      */
      sendAttachmentFromUrlTo(type, url, recipientId, sendOptions) {

The "URL" camel case is wrong at example / documentation.

Sending Files

hi,

im using the socketio bot.

i want to know if you have example of sending a file via the client to botmaster implimentation.

ive found and got the following package working in seperate project:
https://www.npmjs.com/package/socketio-file-upload

but want to know how i could use it with botmaster, or if botmaster has a implimentation to handle files/bytes/bytearray?

regards

willem

Support for voice stream?

Hi,

                         I would like to ask if this framework is applicable accepting voice inputs and chatbot returning voice output as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.