Requesting country code in phone + appending '+' if it's missing

This commit is contained in:
Giovanni Solimeno (Crax) 2020-06-22 15:33:56 +02:00
parent 950da8fa54
commit ef6945d010

View file

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