MattBot is a WhatsApp automation tool.
- Go installed
chromedp
,go-redis
,cobra
, andanthropic-go
Go packages- Redis server running (default: localhost:6379)
- Claude API key
-
Clone the repository:
git clone <repository_url> cd mattbot
-
Download dependencies:
go mod download
-
Compile MattBot:
go build -o mattbot main.go
-
Initialize MattBot with your WhatsApp phone number and Claude API key:
./mattbot init
You will be prompted to enter your phone number (including country code, without the
+
sign or leading zeros) and your Claude API key. -
Run MattBot:
./mattbot run
The program will open a Chrome window and navigate to WhatsApp Web. You need to manually scan the QR code with your WhatsApp mobile app. After scanning the QR code, MattBot will listen for "@" mentions. You can ask MattBot to create calendar events using natural language, for example: "@MattBot create an event called 'Meeting with John' on July 24th at 3pm for 1 hour". MattBot will respond with a confirmation or an error message if any information is missing.
- Make sure Redis is running and accessible.
- The selectors used in the program might need to be adjusted based on the WhatsApp Web version. Inspect the WhatsApp Web page to find the correct selectors if the program fails.
- Error handling is basic. More robust error handling should be implemented for production use.
- This is a basic example and can be extended to perform other automated tasks on WhatsApp Web.