open-wa / wa-automate-python

💬 🤖 The most advanced Python whatsapp library for chatbots with advanced features. Be sure to ⭐ this repository for updates!
Other
349 stars 75 forks source link

How can I tell if another user has saved me as a contact #87

Open fire17 opened 3 years ago

fire17 commented 3 years ago

Hi there! I'm not sure if there's already a proper way to do this, but maybe you guys can be help me be creative and find a solution. I'd like to make a service that only send direct messages to users who have already added me as a contact.

For example, I can open an "onboarding group" with that user where, I send my own VC, send a message to add me as a contact, remove all participants and close the group. Then, i'll wait for userAddedMeAsContact(userID) to be True. And then I can send him a direct message This is useful so that the first time i send a message to a new contact directly, all the links will be displayed properly

I feel like if out of all the data that whatsapp gives when i ask for contact info, one of those might be indicative to whether he add me as a contact...

Any thoughts on how this can be achieved ? Thank you :) Tami

mrodal commented 3 years ago

How can you know if someone has added you as a contact on your phone? I dont think its possible

fire17 commented 3 years ago

Well... there are a few ways actually. 1 confirmed way is to send a "Broadcast Message" to a friend you know saved your contact + another User you can check in the message status "Delivered To". Broadcast msgs only reach people who saved you as a contact. If the message was delivered to that user then he definitely saved you as a contact

another way is to check his name/status/last-seen/isOnline/profile_image check if you can see any of these... and save the results then send (in a group) you own vc with a message to add you... if after that, you can see anyone of these variables (out of those you couldnt see before) then the user definitely saved you as a contact :) I'm not sure what's the default settings for each of these but it's very unlikely for someone to have the exact same privacy settings for both contacts and non-contacts (across all these variables) therefor it should work for most users

These are some that i know... but i wouldnt be surprised if there's also a change in encryption details after he added you as a user i guess the best way is to get details of a user you have access to, then add yourself as a contact then see the differences

I dont have another account to check with but im guessing that there are more indicative variables to be found :) Just gotta find them :)

fire17 commented 2 years ago

Any updates or ideas ? 🙏🌻