Skip to content

Commit 48ce025

Browse files
Update whats.py
1 parent a82415a commit 48ce025

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pywhatkit/whats.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def sendwhatmsg_instantly(
2727
raise exceptions.CountryCodeException("Country Code Missing in Phone Number!")
2828

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

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

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

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

0 commit comments

Comments
 (0)