[THIS THING ISN'T WORKING EVERYTIME (fbchat module issue). USE IT IF YOU CAN DEBUG AND LET ME KNOW IF YOU CAN.]
(...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.
- 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.
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.
Make sure you have installed python3 in your machine. You can also use python2 by converting the whole code. Then:
- Clone this repository:
git clone https://github.com/MS-Jahan/fb-auto-reply-py
- 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 thefbchat
folder. For Windows, you can just download the code (in zip file) for the code in branch v1. - Install requirements:
pip3 install -r requirements.txt --user
- Change directory to this project folder:
cd fb-auto-reply-py
- Edit the msg1.txt, msg2.txt, received.txt, reply.txt and blacklist.txt files following the instructions written in them.
- Now run the script:
python3 run.py
- 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 )
- Now your bot is running!
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.
- Update and upgrade packages:
apt update && apt upgrade
(Press y and enter when prompted to upgrade packages.) - Install python and git:
apt install python git
- Get storage permission; Press Allow:
termux-setup-storage
- Change directory to internal storage:
cd /storage/emulated/0
- Clone this repository:
git clone https://github.com/MS-Jahan/fb-auto-reply-py
- Install necessary python modules:
pip3 install fbchat pygtail getpass --user
- Rename the downloaded project folder:
mv 'fb-auto-reply-py' replybot
- Change directory to this project folder:
cd replybot
- 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.
- Now run the script:
python3 run.py
- Type your email and password when asked. Password will not be visible when typing.
- Now your bot is running!
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.
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. ;-)