diff --git a/README.md b/README.md
index 02b64fc..18cae5a 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,79 @@
-# whatsapp-gpt
-* You'll need to run WhatsApp from a phone number using the golang library I'm using.
-* You'll run a dedicated browser in another window that's controlling ChatGPT.
-* Two terminals: `go run main.go`, and `python server.py`. I am extremely doubtful they will work for you on the first run.
-* You can also try `multichat.py` if you want to watch two ChatGPTs talk to each other.
-* This marks the end of the readme file; it is a bit sparse; thankfully the code is too! Just tuck in if you can... and I will try to add more here later.
+ # whatsapp-gpt-fix
+
+## Introduction
+
+This repository contains a forked and modified version of the original `whatsapp-gpt` project. The current version addresses two main issues I encountered while trying to run the project:
+
+1. **Outdated Client Error** during WebSocket connection.
+2. **Chatbot Integration:** Added a feature to interact with a local chatbot API.
+
+---
+
+## Issue 1: Outdated Client Error
+
+When attempting to connect, the following error appeared:
+
+```bash
+10:09:20.723 [Client/Socket DEBUG] Dialing wss://web.whatsapp.com/ws/chat
+10:09:20.975 [Client/Socket DEBUG] Frame websocket read pump starting 0x140001f24d0
+10:09:23.120 [Client/Recv DEBUG]
+10:09:23.120 [Client ERROR] Client outdated (405) connect failure
+10:09:23.121 [Client/QRChannel DEBUG] Closing channel with status {Event:err-client-outdated Error: Code: Timeout:0s}
+Login event: err-client-outdated
+10:09:23.122 [Client/Socket ERROR] Error reading from websocket: websocket: close 1006 (abnormal closure): unexpected EOF
+```
+
+### Solution
+
+The issue is due to an outdated WhatsApp client. To fix this, upgrade your Go packages by running the following command in your terminal:
+
+```bash
+go get -u ./...
+```
+
+---
+
+## Issue 2: Send Message Error
+
+After addressing the outdated client error, I encountered a new issue related to sending messages using the latest version of the WhatsApp package. The code for sending a message was:
+
+```bash
+# command-line-arguments
+./main.go:61:61: cannot use "" (untyped string constant) as *waE2E.Message value in argument to mycli.WAClient.SendMessage
+./main.go:61:65: cannot use response (variable of type *waE2E.Message) as whatsmeow.SendRequestExtra value in argument to mycli.WAClient.SendMessage
+```
+
+This error is about this line in the code:
+```go
+mycli.WAClient.SendMessage(context.Background(), userJid, "", response)
+```
+
+### Solution
+
+The newest version of the WhatsApp package introduced changes that required updating how messages are sent. The updated implementation now correctly handles sending messages and catching any errors that occur. This ensures that the bot can properly send responses back to users. So I just used the new syntax in the code and it worked:
+
+```go
+_, err = mycli.WAClient.SendMessage(context.Background(), userJid, response, whatsmeow.SendRequestExtra{})
+ if err != nil {
+ fmt.Println("Error sending message:", err)
+ }
+```
+---
+
+## How to Run the Project
+
+1. Clone the repository:
+ ```bash
+ git clone
+ cd whatsapp-gpt-fix
+ ```
+2. Install dependencies and update packages:
+ ```bash
+ go mod tidy
+ go get -u ./...
+ ```
+3. Ensure a chatbot API is running by running `python server.py` in your terminal.
+4. Run the project:
+ ```bash
+ go run main.go
+ ```
diff --git a/main.go b/main.go
index 560b28e..0ea54b2 100644
--- a/main.go
+++ b/main.go
@@ -58,7 +58,12 @@ func (mycli *MyClient) eventHandler(evt interface{}) {
fmt.Println("Response:", response)
userJid := types.NewJID(v.Info.Sender.User, types.DefaultUserServer)
- mycli.WAClient.SendMessage(context.Background(), userJid, "", response)
+
+ //Updating the syntax in the message
+ _, err = mycli.WAClient.SendMessage(context.Background(), userJid, response, whatsmeow.SendRequestExtra{})
+ if err != nil {
+ fmt.Println("Error sending message:", err)
+ }
}
}