make this check a generic one so that all the required env variables are checked before continuing.

Co-authored-by: Christy Roys <royschristy@gmail.com>
This commit is contained in:
RedoX 2021-06-27 03:02:06 +06:00 committed by GitHub
parent 3153308073
commit 1d4eeeccee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -15,9 +15,15 @@ def runSetup():
f"\nCopy your {missing} and save it into Secrets(Environment variables) Sidebar!\n" f"\nCopy your {missing} and save it into Secrets(Environment variables) Sidebar!\n"
) )
api_id = os.getenv("API_ID") req_env_vars = ["API_ID", "API_HASH", "INDEX_SETTINGS"]
if api_id is None: misssing_envs = False
alert() for env_var in req_env_vars:
env_value = os.getenv(env_var )
if env_value is None:
misssing_envs = True
alert(env_var)
if misssing_envs:
return return
session_string = os.getenv("SESSION_STRING") session_string = os.getenv("SESSION_STRING")