From 1d4eeecceee7ff107f9238db5685f586d8a268f6 Mon Sep 17 00:00:00 2001 From: RedoX Date: Sun, 27 Jun 2021 03:02:06 +0600 Subject: [PATCH] make this check a generic one so that all the required env variables are checked before continuing. Co-authored-by: Christy Roys --- run-repl.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/run-repl.py b/run-repl.py index a44866c..3d28cc4 100644 --- a/run-repl.py +++ b/run-repl.py @@ -15,9 +15,15 @@ def runSetup(): f"\nCopy your {missing} and save it into Secrets(Environment variables) Sidebar!\n" ) - api_id = os.getenv("API_ID") - if api_id is None: - alert() + req_env_vars = ["API_ID", "API_HASH", "INDEX_SETTINGS"] + misssing_envs = False + 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 session_string = os.getenv("SESSION_STRING")