forked from ananth-28/tg-index
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-repl.py
34 lines (24 loc) · 898 Bytes
/
run-repl.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
# Code of your application, which uses environment variables (e.g. from `os.environ` or
# `os.getenv`) as if they came from the actual environment.
os.system("alias python3=python")
def runSetup():
def alert(missing):
print(
f"\nCopy your {missing} and save it into Secrets (Environment variables) Sidebar!\n"
)
req_env_vars = ["API_ID", "API_HASH", "INDEX_SETTINGS"]
for env_var in req_env_vars:
env_value = os.getenv(env_var)
if env_value is None:
alert(env_var)
return
if os.getenv("SESSION_STRING") is None:
os.system("python app/generate_session_string.py")
print(
"\nCopy your SESSION_STRING from above and save it into Secrets (Environment variables) Sidebar!"
)
return
os.system("python -m app")
if __name__ == "__main__":
runSetup()