danielgross / whatsapp-gpt

MIT License
3.07k stars 598 forks source link

Everything is OK but still could not work bot on Whatsapp (SOLVED) #36

Open alierkam opened 1 year ago

alierkam commented 1 year ago

Hi All,

I ran main go and server py respectively. Firstly scanned QR code in main.go and i ran server.py. You can see my SS. Doesn create an openai contact in whatsapp and I didn't use the bot. What should I do at this stage?

wp chat image

kazzastic commented 1 year ago

I had the same error where I could not get past the "verify human" after you run the python server, I found this issue in this repository which solved this, https://github.com/danielgross/whatsapp-gpt/issues/28#issuecomment-1364539511 I think its an issue with chromium but with firefox it works!

josevayas commented 1 year ago

Hi @kazzastic, how did you got ChatGPT to open as a new chat in WhatsApp (as the attached pic)..I was able to run both main.go and server.py....chat GPT opened in FireFox but I am not able to open it as new chat...any ideas? thank you

Screenshot 2023-01-15 at 2 58 21 PM
brunooyague commented 1 year ago

Yep I'm having the same problem. It keeps verifing image

josevayas commented 1 year ago

Hi @brunooyague you need to edit the code server.py and adjust it with Firefox... that will fix the problem but won't load or pop-up chat GPT as a new chat in WhatsApp... which is what I have reported...still figuring out..

kazzastic commented 1 year ago

Hi @kazzastic, how did you got ChatGPT to open as a new chat in WhatsApp (as the attached pic)..I was able to run both main.go and server.py....chat GPT opened in FireFox but I am not able to open it as new chat...any ideas? thank you

Screenshot 2023-01-15 at 2 58 21 PM

I thought the chatGPT was supposed to answer the unread/new messages on the whatsapp, and that's how it has been working for me. Are you doing something else? and also what is the OpenAI contact on your whatsapp?

josevayas commented 1 year ago

@kazzastic works the same for me but I wanted to work as Daniel showed in his video in Twitter.. am I missing something? Thank you!

kazzastic commented 1 year ago

@kazzastic works the same for me but I wanted to work as Daniel showed in his video in Twitter.. am I missing something? Thank you!

I actually don't know how @danielgross is doing that from his whatsapp application, I don't think this repository implements that functionality.

hbsfrsim commented 1 year ago

@kazzastic works the same for me but I wanted to work as Daniel showed in his video in Twitter.. am I missing something? Thank you!

But how did you make the chat appear in whatsapp?

kazzastic commented 1 year ago

@kazzastic works the same for me but I wanted to work as Daniel showed in his video in Twitter.. am I missing something? Thank you!

But how did you make the chat appear in whatsapp?

The chatGpt does not appear on your whatsapp, the go script takes the string from your whatsapp unanswered messages, sends it to the python server, the python server sends the string to chatGPT website from where it answers the given string, the python server then takes that string answer from chatGPT website and sends it back as a response, that response is then sent back to go server which sends the response to the whatsapp recipient. I do not have seen the functionality where we chat with chatGPT directly from your whatsapp application.

alierkam commented 1 year ago

Thanks for advice @kazzastic . I am using chatgpt on Whatsapp now ( after firefox update.) But as your said, There was no such thing as daniel's chatbot(OPENAI) in whatsapp. I can send messages from my own number, but I cannot receive messages to my own number. When someone else texts me, chatgpt automatically responds to it. But even that is enough, thanks again for the advice :) chatbot Screenshot 2023-01-19 at 00 37 41

AlvarodOrs commented 1 year ago

I still cant get the bot to send messages, no errors are being logged,

I modified the code to filter messages so it only answers to my messages to a specific group. I get the app to receive the message, send it to GPT and it shows the answer on the terminal. However it doesnt send any message back

EDIT II: I figurated the error, mine´s working flawlesly

AlvarodOrs commented 1 year ago

However, it would be nice to get the answers on whatsapp as a Reply message any ideas?

AlvarodOrs commented 1 year ago

Solved

kazzastic commented 1 year ago

I still cant get the bot to send messages, no errors are being logged,

I modified the code to filter messages so it only answers to my messages to a specific group. I get the app to receive the message, send it to GPT and it shows the answer on the terminal. However it doesnt send any message back

EDIT II: I figurated the error, mine´s working flawlesly

can you also mention the code to filter out the messages to be sent only to a specific group please?

AlvarodOrs commented 1 year ago

Yeah, groupJID := types.NewJID("yourJIDnumber", "the last letters after @") _, err = mycli.WAClient.SendMessage(context.Background(), groupJID, "", response)

AlvarodOrs commented 1 year ago

However, im trying to make something so i can restart server.py if any error occurs. I already implemented a way to send custom commands by excluding them from being sent to GPT, but i don´t know how to restart server.py from the phone.

If you want my full code ill send it np

What im trying to do now its to make a function so I can restart the server.py and try again (bc of the possible network and too many requests issues) but im not making progress

kazzastic commented 1 year ago

what do you mean how to restart server.py from the phone?