bellingcat / telegram-phone-number-checker

Check if phone numbers are connected to Telegram accounts.
https://pypi.org/project/telegram-phone-number-checker/
MIT License
1.02k stars 172 forks source link

Extend --help text to include info for acquiring Telegram API ID/hash #20

Closed jordan-gillard closed 3 months ago

jordan-gillard commented 4 months ago

This PR extends the help text printed to the console when users enter the --help flag. The help text now includes information on prerequisites (like getting an api id and hash) and storing these in a local .env file. It also adds an epilog command argument to point users to the official repo's README.md.

Other changes:

Resolves: #13

Example:

➜ poetry run telegram-phone-number-checker --help
Usage: telegram-phone-number-checker [OPTIONS]

  Check to see if one or more phone numbers belong to a valid Telegram
  account.

  Prerequisites:
  1. A Telegram account with an active phone number
  2. A Telegram App api_id and App api_hash, which you can get by creating
     a Telegram App @ https://my.telegram.org/apps

  Note:
  If you do not want to enter the API ID, API hash, or phone number associated with
  your Telegram account on the command line, you can store these values in a `.env`
  file located within the same directory you run this command from.

  // .env file example:
  API_ID=12345678
  API_HASH=1234abcd5678efgh1234abcd567
  PHONE_NUMBER=+15555555555

  See the official Telegram docs at
  https://core.telegram.org/api/obtaining_api_id for more information on
  obtaining an API ID.

  Recommendations:
  Telegram recommends entering phone numbers in international format
  +(country code)(city or carrier code)(your number)
  i.e. +491234567891

Options:
  -p, --phone-numbers TEXT  List of phone numbers to check, separated by
                            commas
  --api-id TEXT             Your Telegram app api_id  [env var: API_ID]
  --api-hash TEXT           Your Telegram app api_hash  [env var: API_HASH]
  --api-phone-number TEXT   Your phone number  [env var: PHONE_NUMBER]
  --output TEXT             Filename to store results  [default: results.json]
  --help                    Show this message and exit.

  Check out the docs at github.com/bellingcat/telegram-phone-number-checker
  for more information.