vasani-arpit / WBOT

A simple Web based BOT for WhatsApp™ in NodeJS 😜. Working as of 📅 Feb 4th, 2024
Other
990 stars 314 forks source link

WAPI.getMe() doesn't work. #222

Closed jasp402 closed 3 years ago

jasp402 commented 3 years ago

Greetings friends, I was reviewing some of the functions and I wanted to see what data WAPI.getMe() brings me. But it shows me an error.

Cannot read property 'all' of undefined image

I have reviewed the function a bit and solving it was not quite simple. I'll leave the solution here for you to review and test yourself. I thought about simplifying it a bit but this way it is better so that it looks very similar to the previous one.

window.WAPI.getMe = function (done) {
    const rawMe = window.Store.Contact.get(window.Store.Conn.wid._serialized);

    if (done !== undefined) done(rawMe);
    return rawMe;
};

image

it would finally look something like this image

vasani-arpit commented 3 years ago

This is resolved in latest version along with other features. Test it out and let me know. ✌