Skip to content

Auto reply to messages when anyone messages you on Facebook Messenger.

Notifications You must be signed in to change notification settings

MS-Jahan/fb-auto-reply-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[THIS THING ISN'T WORKING EVERYTIME (fbchat module issue). USE IT IF YOU CAN DEBUG AND LET ME KNOW IF YOU CAN.]

Warning

(...from the fbchat module doc: ) We are not responsible if your account gets banned for spammy activities, such as sending lots of messages to people you don’t know, sending messages very quickly, sending spammy looking URLs, logging in and out very quickly… Be responsible Facebook citizens.

Features

  • Option for specific reply to specific or near specific messages.
  • Replies a specific message to every recipient whose messages aren't understood by the bot.
  • If anyone messages you twice which is not understood by bot, then secondary message system is available.
  • If primary and secondary messages are sent once to a recipient, then bot will not reply to the messages of the recipient anymore in an active session, but will reply to the messages which are recognised by the bot.
  • Waits for a random number (between 4 to 10) of seconds before sending every message to act as a human, to minimize the chance of getting blocked from Facebook.
  • Avoids group messages.
  • Blacklist option available if you want the bot not to respond to specific users.

Getting Started At A Glance

After cloning this repository, edit the msg1.txt, msg2.txt, received.txt, reply.txt and blacklist.txt files following the instructions written in them. Don't try to run the program without editing these files. You are definately gonna get error messages. Then, installed required modules from pip3 following the instructions below. Finally, run the run.py program, type your credentials when asked and you're good to go.

Installation

Make sure you have installed python3 in your machine. You can also use python2 by converting the whole code. Then:

  1. Clone this repository: git clone https://github.com/MS-Jahan/fb-auto-reply-py
  2. Run git clone --single-branch --branch v1 https://github.com/MS-Jahan/fbchat.git. You can delete other files and folders (cloned from my fbchat fork) except the fbchat folder. For Windows, you can just download the code (in zip file) for the code in branch v1.
  3. Install requirements: pip3 install -r requirements.txt --user
  4. Change directory to this project folder: cd fb-auto-reply-py
  5. Edit the msg1.txt, msg2.txt, received.txt, reply.txt and blacklist.txt files following the instructions written in them.
  6. Now run the script: python3 run.py
  7. Type your email and password when asked. Password will not be visible when typing. (You will not need to type your credentials next time if you don't change your password or log out from session )
  8. Now your bot is running!

Using on Android

To use this python tool on Android, you have to install a linux terminal emulator named Termux which is available on Google Play Store. After Installing Termux, open the app, write down the commands stated below one by one and press enter.

  1. Update and upgrade packages: apt update && apt upgrade (Press y and enter when prompted to upgrade packages.)
  2. Install python and git: apt install python git
  3. Get storage permission; Press Allow: termux-setup-storage
  4. Change directory to internal storage: cd /storage/emulated/0
  5. Clone this repository: git clone https://github.com/MS-Jahan/fb-auto-reply-py
  6. Install necessary python modules: pip3 install fbchat pygtail getpass --user
  7. Rename the downloaded project folder: mv 'fb-auto-reply-py' replybot
  8. Change directory to this project folder: cd replybot
  9. Edit the msg1.txt, msg2.txt, received.txt, reply.txt and blacklist.txt files using any text editor (or nano in Termux) following the instructions written in them.
  10. Now run the script: python3 run.py
  11. Type your email and password when asked. Password will not be visible when typing.
  12. Now your bot is running!

Reporting Issues

As I'm a noob in writing codes, this python tool may look sarcastic, even this README.md file. Feel free to open an issue for bugs, improvements, suggestions or anything important for developing this tool.

Credits

The main core of this project is the fbchat module. Without the module, it would be a very difficult task. I just read their doc and copied their example code and modified it for beginner users. ;-)

About

Auto reply to messages when anyone messages you on Facebook Messenger.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages