2 Commits

Author SHA1 Message Date
msramalho
2a503856c2 fix poetry build default env file is empty 2024-02-08 15:08:35 +00:00
msramalho
d7f5415a4e fixes .env not working from CLI 2024-02-08 12:52:50 +00:00
2 changed files with 3 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "telegram-phone-number-checker"
version = "1.0.3"
version = "1.0.5"
description = "Check if phone numbers are connected to Telegram accounts."
authors = ["Bellingcat"]
license = "MIT"

View File

@@ -1,12 +1,10 @@
import os, json, re
from telethon.sync import TelegramClient, errors, functions
from telethon.tl.types import InputPhoneContact
from dotenv import load_dotenv
from dotenv import load_dotenv, dotenv_values, find_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(".env")
client = login(api_id, api_hash, api_phone_number)
res = validate_users(client, phone_numbers)
show_results(output, res)