Merge pull request #85 from Crax97/country_code

Requesting country code when the user forgets it
This commit is contained in:
Nameless 2020-06-22 21:50:16 +08:00 committed by GitHub
commit 73bb8b2de6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,7 +76,12 @@ else:
os.makedirs(directory, exist_ok=True) os.makedirs(directory, exist_ok=True)
if not PHONE: if not PHONE:
print(
"Enter your phone number in international format (including country code)"
)
PHONE = input("phone> ") PHONE = input("phone> ")
if not PHONE.startswith("+"):
PHONE = "+" + PHONE
with open(CONFIG_FILE, "w") as f: with open(CONFIG_FILE, "w") as f:
f.write(f"PHONE = '{PHONE}'\n") f.write(f"PHONE = '{PHONE}'\n")