GithubHelp home page GithubHelp logo

o-x-y-g-e-n / facebook-autoreply-bot Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 7.0 34.13 MB

Responds to all new messages with a message.

License: MIT License

JavaScript 100.00%
facebook-messenger-bot bot facebook-bot auto-reply facebook-graph-api facebook-chat-api auto-responser nodejs javascript

facebook-autoreply-bot's Introduction

Facebook Auto-Reply Bot

Maintenance GitHub license GitHub contributors PRs Welcome Open Source? Yes!

Image

This is an utility to automate the responses to all the unread / new messages on Facebook

  • Respond to all the unread messages on Facebook
  • Respond to all the new messages on Facebook
  • Setup Cron (jobs) for continuous checking of new messages.

Tech

Project uses a number of open source projects to work properly:

Installation

Dillinger requires Node.js v8+ to run.

Install the dependencies and devDependencies:

$ cd facebook-autoreply-bot
$ npm install -d

Configuration

  1. Open default.json from config folder using your favourite text editor.
  2. Enter your Facebook Credentials there. (Key email & password)
  3. Enter the message (you want to reply with) for data key.
  4. Run the below scripts (depending on the system) :
    • script-win.exe if Windows OS.
    • script-macos if MacOS.
    • script-linux if Linux.
  5. On Success, all the unread messages will be responded and the program will quit.

Tips on Writing the message

  1. Use \n in the message to enter a new line.
  2. Use $name to get the sender name in the message body.

Example

For the config file similar to this

{
	"Credentials": {
		"email": "[email protected]",
		"password": "thisisnotmypassword",
		"data": "Hello $name .... Thank you so much for your interest.The Property Mgmt Company is in the process of accepting applications. To get started, there is a three step process \n1) Complete the eligibility form (https://goo.gl/ab83ad),\n2) Complete Registration (with your email address - We will send you the link),and lastly\n3) Complete the application.\n\nPlease call if you have question $name.\nThank You!\nJohn Group Realty | Indian Ocean Pacific."
	}
}

where [email protected] is your Facebook login email address and thisisnotmypassword is your Facebook login password. You have to enter correct credentials. For the message body, assuming we are responding to message from John Kennedy, the respond would look something like this

Hello John .... Thank you so much for your interest.The Property Mgmt Company is in the process of accepting applications. To get started, there is a three step process
1) Complete the eligibility form (https://goo.gl/ab83ad),
2) Complete Registration (with your email address - We will send you the link),and lastly
3) Complete the application.

Please call if you have question $name.
Thank You!
John Group Realty | Indian Ocean Pacific.

As you can see, all the \n are replaced with a newline and $name is replaced with John (in our case).

Setting up the Cron Job

If you want to continuously check for new messages (after every fixed time interval), and respond to the new messages, you need to run a different script. Follow Step 1,2,3 from the Configuration Heading and for the 4th step, run the following scripts. * script-repeat-win.exe for Windows OS. * script-repeat-macos for MacOS. * script-repeat-linux for Linux. The above scripts are designed to check for new messages every 10 minutes. (This is not configurable yet, I am working on it!). As oppose to previous script, this script won't quit on success, but will run forever and check for new messages every 10 minutes.

Important Points to Consider

  • The Script will reply only the new messages or unread messages. (The messages sitting in your messanger in Bold).
  • New Messages once replied will not be replied again.
  • It is recommended not to be online on Facebook (from browser) while running the script.
  • Facebook has become very script about any third party software accessing your account ( Because of the data lick that happened recently). So i suggest you to run the script manually (whenever required) instead of setting up the cron job.

Future Improvements

  • GUI
  • Option to configure Cron Script Time

License

MIT

ForTheBadge built-with-love

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.