This is a very simple bot created to automate the deletion of Facebook Messenger chats on the URL https://www.facebook.com/messages. Since Messenger does not provide an option to delete all messages at once, this bot was designed to speed up the process.
The bot primarily relies on screen positions to interact with the Messenger interface. It was created with the sole purpose of solving this problem as quickly as possible, without any advanced automation frameworks.
Install the necessary dependencies:
pip install -r requirements.txtContents of requirements.txt:
keyboard==0.13.5
MouseInfo==0.1.3
opencv-python==4.11.0.86
pillow==9.5.0
PyAutoGUI==0.9.54
pynput==1.7.7
- Open the Facebook Messenger page: https://www.facebook.com/messages.
- Position the browser window properly on your screen.
- Run the script:
python delete_message_bot_position.py
- Press
ESCat any time to stop the script.
delete_message_bot_position.py: Main script for automating chat deletion.delete_option.png: Image used for detecting the "Delete Chat" button.tela_teste.png: Debug screenshot to ensure the UI elements are being captured correctly.position.py: A helper script to capture mouse positions on the screen. It records positions as you click the mouse or press thePkey.requirements.txt: Lists the Python dependencies for this project.
This bot is a quick and basic solution for personal use. Automating actions on third-party platforms like Facebook may violate their terms of service. Use responsibly.
Created by Arthur Graf.