Closed fredy1221 closed 3 years ago
Hi, I wanted this library to be safe, adding that feature would allow user to spam others and which ultimately affect the library because WhatsApp doesn't allow any spamming activity, someone might report this library and I might end up losing it.
I just wanted to do an app that will send PCR results of a lab to its clients, no spamming just charity work, because they're doing it manually
@Ankit404butfound is right. Doing that could be useful but it has a downside too. But i think there must be way that closes the previously opened tab if a new sendwhatmsg() function call is given or something like this.
I just wanted to do an app that will send PCR results of a lab to its clients, no spamming just charity work, because they're doing it manually
Did you find any other way to do so?
Nop, I didn't really look into it since then.
import pyautogui as pg import webbrowser as web import time
GROUP = 'yougrouphere' message = yourmessagehere'
def WhatsApp(GROUP, message): web.open('https://web.whatsapp.com/accept?code=' + GROUP) time.sleep(10) width, height = pg.size() pg.click(width / 2, height / 2) pg.typewrite(message + "\n") time.sleep(3) pg.hotkey('ctrl', 'w') time.sleep(3) pg.press('enter')
WhatsApp(GROUP, message)
I think while we are adding time delay in sending messages (and can be set to min 3 seconds), it can be implemented. It would make this library more efficient.
I'm always frustrated when using the "sendwhatmsg" function in a loop, it opens a new tab every time.
Can we have it use the existing tab?
NB: I'm using pg.press("enter") to send the message, otherwise, it just copy-pastes in the text field.