Skip to content

Commit

Permalink
click.prompt to input for notebooks compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
msramalho committed Jan 25, 2024
1 parent dd6108a commit 3c9cb2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "telegram-phone-number-checker"
version = "1.0.1"
version = "1.0.2"
description = "Check if phone numbers are connected to Telegram accounts."
authors = ["Bellingcat"]
license = "MIT"
Expand Down
8 changes: 4 additions & 4 deletions telegram_phone_number_checker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def validate_users(client, phone_numbers):
The function uses the get_api_response function to first check if the user exists and if it does, then it returns the first user name and the last user name.
'''
if not phone_numbers or not len(phone_numbers):
phone_numbers = click.prompt('Enter the phone numbers to check, separated by commas')
phone_numbers = input('Enter the phone numbers to check, separated by commas: ')
result = {}
phones = [p.strip() for p in phone_numbers.split(",")]
try:
Expand All @@ -62,9 +62,9 @@ def validate_users(client, phone_numbers):
def login(api_id, api_hash, phone_number):
"""Create a telethon session or reuse existing one"""
print('Logging in...', end="", flush=True)
API_ID = api_id or os.getenv('API_ID') or click.prompt('Enter your API ID')
API_HASH = api_hash or os.getenv('API_HASH') or click.prompt('Enter your API HASH')
PHONE_NUMBER = phone_number or os.getenv('PHONE_NUMBER') or click.prompt('Enter your phone number')
API_ID = api_id or os.getenv('API_ID') or input('Enter your API ID: ')
API_HASH = api_hash or os.getenv('API_HASH') or input('Enter your API HASH: ')
PHONE_NUMBER = phone_number or os.getenv('PHONE_NUMBER') or input('Enter your phone number: ')
client = TelegramClient(PHONE_NUMBER, API_ID, API_HASH)
client.connect()
if not client.is_user_authorized():
Expand Down

0 comments on commit 3c9cb2a

Please sign in to comment.