From d7f5415a4e0e554b2faf41821b488b6026bc5e29 Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Thu, 8 Feb 2024 12:52:50 +0000 Subject: [PATCH] fixes .env not working from CLI --- pyproject.toml | 2 +- telegram_phone_number_checker/main.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9a0dd96..2d6539e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "telegram-phone-number-checker" -version = "1.0.3" +version = "1.0.4" description = "Check if phone numbers are connected to Telegram accounts." authors = ["Bellingcat"] license = "MIT" diff --git a/telegram_phone_number_checker/main.py b/telegram_phone_number_checker/main.py index 5bd0b1d..a1b862a 100644 --- a/telegram_phone_number_checker/main.py +++ b/telegram_phone_number_checker/main.py @@ -5,8 +5,6 @@ from dotenv import load_dotenv from getpass import getpass import click -load_dotenv() - def get_names(client, phone_number): """ This function takes in a phone number and returns the username first name and the last name of the user if the user exists. It does so by first adding the user's phones to the contact list, retrieving the information, and then deleting the user from the contact list. @@ -90,6 +88,7 @@ def show_results(output, res): @click.option('--output', help='results filename, default to results.json', default="results.json", type=str) def main_entrypoint(phone_numbers, api_id, api_hash, api_phone_number, output): """Check to see if one or more phone numbers belong to a valid Telegram account""" + load_dotenv() client = login(api_id, api_hash, api_phone_number) res = validate_users(client, phone_numbers) show_results(output, res)