WhatsGuard is a sophisticated WhatsApp bot designed to protect groups from spam and advertisements while providing advanced management tools for administrators. It leverages the power of the Petroly.co API for intelligent message filtering and spam detection.
IMPORTANT: Using automated or unofficial software with WhatsApp may violate their Terms of Service and could potentially lead to your account being banned. WhatsGuard is an unofficial tool not endorsed by WhatsApp. Use this bot at your own risk. The developers of WhatsGuard are not responsible for any consequences resulting from the use of this software, including but not limited to account bans or restrictions.
I strongly recommend:
- Using this bot with a dedicated WhatsApp account, not your primary personal account.
- Being aware of WhatsApp's policies regarding automated tools and bots.
- Monitoring WhatsApp's Terms of Service for any changes that might affect the use of this bot.
By using WhatsGuard, you acknowledge and accept these risks.
- Automatic spam and advertisement detection
- Group management assistance for admins
- Integration with Petroly.co API for enhanced spam filtering
- Automatic message deletion for detected spam
- Node.js
- whatsapp-web.js
- GraphQL (for API communication)
- Docker for containerization
- Fly.io for deployment
- Node.js (v21.5.0 or later recommended)
- npm
- Docker (for containerized deployment)
- The Petroly.co API (for spam detection service)
-
Clone the repository:
git clone https://github.com/your-username/whatsguard.git cd whatsguard
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env
file in the root directory and add your Petroly.co API endpoint:GRAPHQL_ENDPOINT=https://api.petroly.co/
To run WhatsGuard locally:
npm start
On first run, you'll need to authenticate by scanning a QR code with your WhatsApp account.
This project is configured for deployment on Fly.io. Make sure you have the Fly CLI installed and are logged in.
-
Create a Fly app:
fly launch
-
Deploy the app:
fly deploy
The fly.toml
file is pre-configured for deployment, including volume mounts for persistent storage.
To build and run the Docker container locally:
-
Build the image:
docker build -t whatsguard .
-
Run the container:
docker run -d --name whatsguard whatsguard
Contributions are welcome! Please feel free to submit a Pull Request.
- whatsapp-web.js for providing the WhatsApp Web API