Giter VIP home page Giter VIP logo

susi_fbbot's Introduction

AskSusi Facebook Messenger Bot

Development Build Status Master Build Status CircleCI Code Climate Join the chat at https://gitter.im/fossasia/susi_server

This is the Facebook messenger bot for AskSusi.

Technology Stack

node.js and Express.

Getting Started

It's easy for you to create your own facebook messenger bot and integrate susi's API into it. You can read the documentation as prepared by the Messenger team.

Messenger bots uses a web server to process messages it receives or to figure out what messages to send. You also need to have the bot be authenticated to speak with the web server and the bot approved by Facebook to speak with the public.

Setup your own Messenger Bot

  1. Fork this repository.

  2. Create a facebook page here.

Creating a FB Page

New FB Page

  1. Create a new Google Cloud or Heroku App.

New Heroku App

  1. Connect the heroku app to the forked repository.

Connect to Github

  1. Deploy on development branch. If you intend to contribute, it is recommended to Enable Automatic Deploys.

Branch Deployment

Successful Deployment

  1. Create or configure a Facebook App or Page here

New FB App

  1. Get started with Messenger tab in the created app.

Messenger Selection

  1. In the Page Access Token select the fb page that you created and generate the token and save it somewhere for future use.

Token Generation

  1. Now, go to the heroku app, select the settings tab and add the environment variable as shown, where key is FB_PAGE_ACCESS_TOKEN and value is the token generated in the previous step.

Environment Variable

  1. Create a webhook on the facebook app dashboard. The Callback url should be https://<your_app_name>.herokuapp.com/webhook/ and rest should be as shown in the image below.

Webhook Creation

App Complete

  1. Go to Terminal and type in this command to trigger the Facebook app to send messages. Remember to use the token you requested earlier.
curl -X POST "https://graph.facebook.com/v2.6/me/subscribed_apps?access_token=<PAGE_ACCESS_TOKEN>"
  1. Go to the facebook page created and locate 'Message Now' or go to https://m.me/PAGE_USERNAME

Message on Page

  1. Enjoy chatting with Susi.

Message on Page

Branch Policy

The default branch is development, so make sure you contribute only on this branch.

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE, Version 3. Please find more info in our license document.

susi_fbbot's People

Contributors

aliayub007 avatar anupkumarpanwar avatar daminisatya avatar fatimarafiqui avatar husain-zaidi avatar manveer695 avatar mariobehling avatar marvin08 avatar pri22296 avatar saptaks avatar shivenmian avatar sudheesh001 avatar thatdns 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  avatar  avatar

susi_fbbot's Issues

Change the SUSI replies U.I.

Actual Behaviour
Susi Fbbot replies in text llike this:
fbbotreplyweb

Expected Behaviour
It would look better, if it replies this way:
fbgoodui

Would you like to work on the issue?
Yes, working on it.

Close issues automatically when a PR is merged

Actual Behaviour

Error in PR template. In PR template it says

Fixes issue #number

Expected Behaviour

Change this to

Fixes #number

This will close the issue automatically when PR is merged.
Title suggestion should be commented out.

Would you like to work on the issue?

Yes

Susi Fbbot not set up

Looks like the fbbot (I am testing it from here) is not currently set up and we don't have access to the susi_fbbot account.

Screenshot (No replies to the messages):
asksusifb

@shivenmian Could you share the account login please by an email to the mentors or to me here: [email protected]?

Also, if I am testing the wrong page on FB please let me know.
Thank you.

Add package-lock.json

Actual Behaviour

Currently, package-lock.json is not committed.

Expected Behaviour

package-lock.json should be committed. See here https://stackoverflow.com/questions/44206782/do-i-commit-the-package-lock-json-file-created-by-npm-5#answer-44210813

 package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates.

Steps to reproduce it

Add steps to reproduce bugs or add information on the place where the feature should be implemented. Add links to a sample deployment or code.

LogCat for the issue

Provide logs for the crash here

Screenshots of the issue

Where-ever possible attach a screenshot of the issue.

Would you like to work on the issue?

Yes, wanna work on this issue.

Getting started guide missing

Actual Behaviour
Getting started guide referred in the Readme is missing

Expected Behaviour
It should point to a getting started guide.

Would you like to work on the issue?
Yes,but I need help on setting it up.

Documentation insufficient

The documentation lacks complete guidance. It has no information on webhook setup procedure and also lacks app deployment methodology for any server, such as heroku. @mariobehling Can I take this issue?

Remove README.md~ and Add auto-deploy buttons for Docker and Heroku

Actual Behaviour

Currently, no auto-deployment buttons are present.

Expected Behaviour

Adding auto deployment buttons for Heroku and Docker.

Steps to reproduce it

Add steps to reproduce bugs or add information on the place where the feature should be implemented. Add links to a sample deployment or code.

LogCat for the issue

Provide logs for the crash here

Screenshots of the issue

Where-ever possible attach a screenshot of the issue.

Would you like to work on the issue?

Yes

Send messages to user having a phone number

If we know a user's phone number, the bot should send them a Message Request without requiring them to first interact with the SUSI AI page.

Would you like to work on the issue?
Yes, work in progress.

U.I should be similar to SUSI web app

The U.I. should be almost same to SUSI web app for a generic view of SUSI AI. Making it generic, also allows increasing the number of results shown in RSS and table type replies in SUSI Fbbot.

Would you like to work on the issue?
Yes, working on it.

Sample.js is failing to run properly

Actual Behaviour

Tests are failing

Expected Behaviour

sample.js should run and thus complete testing

Steps to reproduce it
just run npm tests.

Adding communication channel in readme

Actual Behaviour
Currently, there is no link to the communication channel on gitter.

Expected Behaviour
There should be a link to the communication channel in readme.

Would you like to work on the issue?
Yes.

"How to contribute" button should be shown

When a person queries with "get started". The following result is shown:
fbgetstartedanswer

It would be great if we can add a "How to contribute" button to it.

Would you like to work on the issue?
Yes, working on it.

Update SUSI API

Actual Behaviour

SUSI API is outdated.

Expected Behaviour

API should be updated.

Would you like to work on the issue?

Yes

Not showing RSS reply.

The bot has stopped showing rss results.

Screenshots of the issue
foundwebfbnotworking

Would you like to work on the issue?
Yes.

Log in to SUSI from SUSI FBbot

I will check if we can try to make a person login to SUSI AI from SUSI Fbbot. Facebook developers login feature may help us.

Would you like to work on the issue?
Yes, I am trying to solve it.

Fix image links for yaydoc

Actual Behaviour

The image links are relative the root of the repository. So they are not rendered when docs are build using yaydoc.

Expected Behaviour

The should be relative to the current document

Would you like to work on the issue?

Yes

Error on starting the server

Actual Behaviour

The server doesn't run and error is shown on the console.

Expected Behaviour

The node server should run.

Steps to reproduce it

node index.js

LogCat for the issue

$ node index.js 

/home/anup/susi_fbbot/index.js:272
				else{
				^^^^

SyntaxError: Unexpected token else
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

Screenshots of the issue

image

Would you like to work on the issue?

Yes

Bug in updating deployment image on each commit

Actual Behaviour

Currently, there is a bug due to which updates are not being pushed to kubernetes deployment.

Expected Behaviour

Deployment image should be updated

Would you like to work on the issue?

Yes

No answers to "table" type queries

This issue arose due to the changes in the returned data from SUSI API, like the table columns are now available inside actions[1] object instead of actions[0] previously.

Would you like to work on the issue?
Yes.

Suggestions in the issue template should be commented out

Actual Behaviour

Suggestions are simply written in the issue template.

Expected Behaviour

Rather, they should be commented out so that contributor doesn't have to delete them manually.

Would you like to work on the issue?

Yes

Can't share SUSI AI messages with others

Actual Behaviour
We can't share a reply by SUSI AI, with a friend. As seen in the screenshot below:

Screenshots
sharemessage

Would you like to work on the issue?
Yes, working on it

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.