whatsplay / whatsapp-play

Command line software through which you can play with your WhatsApp. It is having different options to play with your WhatsApp like message blast, online tracking, whatsapp chat..
MIT License
405 stars 217 forks source link

Broadcast Idea #273

Closed xandao-dev closed 4 years ago

xandao-dev commented 4 years ago

Load a file with phone numbers and send a message to all of them! The difference between this and the Whatsapp broadcast in smartphone is that we can send message even if we don't have that contact!

zulkernine commented 4 years ago

I would like to work on this. I just got a reference that how to send message through api.whatsapp.com, here's a link of it : https://www.androidpit.com/send-whatsapp-message-without-adding-contact-to-address-book . Can i implement it here? Or please suggest some better ways.

xandao-dev commented 4 years ago

@zulkernine I'm refactoring the project and I already included this feature to send message to unknown number. I will release it soon. So wait for my release to start working on this issue.

zulkernine commented 4 years ago

Ok. I'm waiting ☺️

xandao-dev commented 4 years ago

@zulkernine ready

zulkernine commented 4 years ago

What is the type of the file ? In which format will it contains those numbers??

xandao-dev commented 4 years ago

a simple txt, 1 number per line:

9194848948 4848946548 4684848648

zulkernine commented 4 years ago

Alright

zulkernine commented 4 years ago

Should I use that api to send message to unsaved number? In that case , whatsapp web will be opened in the new tab again, thus it would take a very long time. So what should I do??

xandao-dev commented 4 years ago

use this method: search_and_select_target. It will detect the number and load the page, without opening a new one

xandao-dev commented 4 years ago

so you can put it in a for loop:

for number in numbers:
    search_and_select_target(page, number)
    send message
zulkernine commented 4 years ago

I got the idea :) I'm starting to implement it . I'll make the commit soon.

zulkernine commented 4 years ago

Searching the target(through number) more than once gives this pop up. How to disable this pop up ?

WhatsApp Image 2020-04-09 at 1 34 56 AM

If this check box is checked ( which comes during second target search) , then it doesn't any more.

WhatsApp Image 2020-04-09 at 1 36 40 AM

zulkernine commented 4 years ago

My code is ready for commit except this issue(Mentioned upper).

zulkernine commented 4 years ago

a simple txt, 1 number per line:

9194848948 4848946548 4684848648

Should I assume all the numbers are correct and has a whatsapp account? Number will contain country code or not?

I implemented it in such a way that if country code is provided then alright otherwise indian country code is used.

xandao-dev commented 4 years ago

https://stackoverflow.com/questions/46669788/how-to-handle-popups-in-puppeteer

xandao-dev commented 4 years ago

skip the number if error and log a message.

zulkernine commented 4 years ago

skip the number if error and log a message.

Following error is skipped in the try_load_contact_by_number() in target search. Consequently, Though the number is invalid, this function is returning true leading to exit call in get_focused_target_title(). :(

IMG_20200409_115025

xandao-dev commented 4 years ago

Think that all numbers are valid, I will fix this in the weekend.

zulkernine commented 4 years ago

Ok

zulkernine commented 4 years ago

A PR is created regarding this issue . Please review.

zulkernine commented 4 years ago

What happened? What about that PR?