Requesting country code when the user forgets it

This commit is contained in:
Giovanni Solimeno (Crax) 2020-06-21 13:37:41 +02:00
parent e7b53eee3b
commit 950da8fa54

View file

@ -77,6 +77,12 @@ else:
if not PHONE:
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
with open(CONFIG_FILE, "w") as f:
f.write(f"PHONE = '{PHONE}'\n")