mirror of
https://github.com/paul-nameless/tg
synced 2024-11-22 11:53:08 +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)
|
||||
|
||||
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")
|
||||
|
|
Loading…
Reference in a new issue