🚀 bot launcher added

This commit is contained in:
Rayan fernandes 2021-06-06 17:01:26 +05:30
parent 0cd6a136c0
commit ffb719613c
1 changed files with 29 additions and 0 deletions

29
run-dev.py Normal file
View File

@ -0,0 +1,29 @@
import os
from dotenv import load_dotenv
load_dotenv() # take environment variables from .env.
# 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="API_ID , API_HASH"):
print(f"\nCopy your {missing} and save it into Secrets(Environment variables) Sidebar!\n")
api_id = os.getenv("API_ID")
if api_id == None:
alert()
return
session_string = os.getenv("SESSION_STRING")
if session_string == None:
os.system("python app/generate_session_string.py")
alert(missing = "SESSION_STRING")
return
os.system("python -m app")
if __name__ == '__main__':
runSetup()