mukulhase / WebWhatsapp-Wrapper

An API for sending and receiving messages over web.whatsapp [Working as of 18th May 2018]
https://webwhatsapi.readthedocs.io/en/latest/
MIT License
2.04k stars 795 forks source link

Start a new conversation #391

Open gabrieldesousah opened 6 years ago

gabrieldesousah commented 6 years ago

Hello guys, I not use this lib in my project, but I use to learn and develop it. I am with a new problem: Start a chat with a number that not contact me any time is with the next problem: model : createdLocally : true id : "55628112345@c.us" __proto__ : Object name : "ModelCreateError" stack : "ModelCreateError: t↵ at t.n (https://web.whatsapp.com/app.1c6cccbeae5d099f4d1e.js:19:20325)↵ at new t (https://web.whatsapp.com/app.1c6cccbeae5d099f4d1e.js:20:2887)↵ at https://web.whatsapp.com/app.1c6cccbeae5d099f4d1e.js:9:31640↵ at x (https://web.whatsapp.com/app.1c6cccbeae5d099f4d1e.js:30:31007)↵ at MutationObserver.I (https://web.whatsapp.com/app.1c6cccbeae5d099f4d1e.js:30:30499)"

I use this code: document.querySelector("#app")._reactRootContainer._internalRoot.current.child.child.child.child.child.child.sibling.sibling.sibling.sibling.sibling.child.child.child.child.child.sibling.sibling.sibling.sibling.sibling.child.child.child.child.memoizedState.chats[0].collection.find("1111111111@c.us")

How I can start a new chat without use my cellphone? Obs: I try save the contact in my cellphone, but the problem persist

brunosoaresds commented 6 years ago

You’re using an old version, probably from pip. That version doesn’t work since may 2018. Checkout the version in this repository and apply manually the patch of PR #380 because last Friday WP changes the chatID scheme and the @mukulhase doesn’t approved the PR yet.