mirror of
https://github.com/paul-nameless/tg
synced 2025-02-16 18:48:24 +00:00
Requesting country code in phone + appending '+' if it's missing
This commit is contained in:
parent
950da8fa54
commit
ef6945d010
1 changed files with 2 additions and 5 deletions
|
@ -76,13 +76,10 @@ 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("+"):
|
if not PHONE.startswith("+"):
|
||||||
COUNTRY_CODE = input("country code> ")
|
PHONE = "+" + PHONE
|
||||||
if not COUNTRY_CODE.startswith("+"):
|
|
||||||
COUNTRY_CODE = "+" + COUNTRY_CODE
|
|
||||||
|
|
||||||
PHONE = COUNTRY_CODE + 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")
|
||||||
|
|
Loading…
Add table
Reference in a new issue