danielgross / whatsapp-gpt

MIT License
3.07k stars 596 forks source link

Specifically answered messages do not work #49

Closed specialOne-coder closed 1 year ago

specialOne-coder commented 1 year ago

When someone sends me a message, everything works fine, the message is sent to GPT which responds very well, but when someone responds to a specific message, Nothing works, the message is not displayed in the go console and is not sent to gpt.

I think the events are not getting the specific responses, does anyone have any idea what is going on and can help please ?

kazzastic commented 1 year ago

are you talking about whenever someone replies to your message by swiping left on it, it doesn't get recognized by the go server?

specialOne-coder commented 1 year ago

yes, finally find the solution by doing this :

       newMessage = v.Message
       quoted := newMessage.ExtendedTextMessage
       var msg string
       if quoted == nil {
        msg = newMessage.GetConversation()
    } else {
        msg = quoted.GetText()
    }
        ...

are you talking about whenever someone replies to your message by swiping left on it, it doesn't get recognized by the go server?

kazzastic commented 1 year ago

maybe highlight the issue and make a PR for this solution.

specialOne-coder commented 1 year ago

maybe highlight the issue and make a PR for this solution.

Yes, I just made a pull request with other improvements, in particular the use of an api key instead of going through a browser each time. This improves the response time and the bugs related to the browsers : https://github.com/danielgross/whatsapp-gpt/pull/50