Skip to content

Commit

Permalink
Update whats.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SigireddyBalasai authored Nov 20, 2022
1 parent a82415a commit 48ce025
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pywhatkit/whats.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def sendwhatmsg_instantly(
raise exceptions.CountryCodeException("Country Code Missing in Phone Number!")

phone_no = phone_no.replace(" ", "")
if not fullmatch(r"^\+?[0-9]{2,4}\s?[0-9]{10}$", phone_no):
if not fullmatch(r"^\+?[0-9]{2,4}\s?[0-9]{9,15}", phone_no):
raise exceptions.InvalidPhoneNumber("Invalid Phone Number.")

web.open(f"https://web.whatsapp.com/send?phone={phone_no}&text={quote(message)}")
Expand Down Expand Up @@ -55,7 +55,7 @@ def sendwhatmsg(
raise exceptions.CountryCodeException("Country Code Missing in Phone Number!")

phone_no = phone_no.replace(" ", "")
if not fullmatch(r"^\+?[0-9]{2,4}[0-9]{10}$", phone_no):
if not fullmatch(r'^\+?[0-9]{2,4}\s?[0-9]{9,15}', phone_no):
raise exceptions.InvalidPhoneNumber("Invalid Phone Number.")

if time_hour not in range(25) or time_min not in range(60):
Expand Down

0 comments on commit 48ce025

Please sign in to comment.