Skip to content

Commit

Permalink
Merge pull request #197 from ns23k/master
Browse files Browse the repository at this point in the history
fixes #195
  • Loading branch information
SigireddyBalasai authored Nov 19, 2022
2 parents da8697d + bb57665 commit a82415a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pywhatkit/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ def findtextbox() -> None:
location = locateOnScreen(f"{dir_path}\\data\\pywhatkit_smile1.png")
try:
moveTo(location[0] + 150, location[1] + 5)
click()
except Exception:
location = locateOnScreen(f"{dir_path}\\data\\pywhatkit_smile.png")
moveTo(location[0] + 150, location[1] + 5)
click()
click()


def check_connection() -> None:
Expand Down Expand Up @@ -74,7 +75,7 @@ def send_message(message: str, receiver: str, wait_time: int) -> None:

_web(receiver=receiver, message=message)
time.sleep(7)
click(WIDTH / 2, HEIGHT / 2)
click(WIDTH / 2, HEIGHT / 2 + 15)
time.sleep(wait_time - 7)
if not check_number(number=receiver):
for char in message:
Expand Down Expand Up @@ -132,7 +133,7 @@ def send_image(path: str, caption: str, receiver: str, wait_time: int) -> None:

_web(message=caption, receiver=receiver)
time.sleep(7)
click(WIDTH / 2, HEIGHT / 2)
click(WIDTH / 2, HEIGHT / 2 + 15)
time.sleep(wait_time - 7)
copy_image(path=path)
if not check_number(number=receiver):
Expand Down
2 changes: 1 addition & 1 deletion pywhatkit/whats.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def sendwhatmsg_instantly(

web.open(f"https://web.whatsapp.com/send?phone={phone_no}&text={quote(message)}")
time.sleep(4)
pg.click(core.WIDTH / 2, core.HEIGHT / 2)
pg.click(core.WIDTH / 2, core.HEIGHT / 2 + 15)
time.sleep(wait_time - 4)
core.findtextbox()
pg.press("enter")
Expand Down

0 comments on commit a82415a

Please sign in to comment.