diff --git a/userbot/__init__.py b/userbot/__init__.py index 67910be6e..8cbead5e7 100644 --- a/userbot/__init__.py +++ b/userbot/__init__.py @@ -16,22 +16,25 @@ LOGS.error("You MUST have a python version of at least 3.6. Multiple features depend on this. Bot quitting.") quit(1) dotenv.load_dotenv('config.env') -if ___________PLOX_______REMOVE_____THIS_____LINE__________ in locals(): +try: + print(___________PLOX_______REMOVE_____THIS_____LINE__________) +except NameError: + API_KEY = os.environ.get('API_KEY', None) + API_HASH = os.environ.get('API_HASH',None) + LOGGER_GROUP=os.environ.get('LOGGER_GROUP',None) + LOGGER=os.environ.get('LOGGER',None) #Incase you want to turn off logging, put this to false + PM_AUTO_BAN=os.environ.get('PM_AUTO_BAN',None) + CONSOLE_LOGGER_VERBOSE=os.environ.get('CONSOLE_LOGGER_VERBOSE',None) + DB_URI=os.environ.get('DB_URI',None) + if CONSOLE_LOGGER_VERBOSE: + logging.basicConfig( + format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", + level=logging.DEBUG) + LOGS = logging.getLogger(__name__) + bot = TelegramClient('userbot',API_KEY,API_HASH) +else: LOGS.error("Your config file seems to be un-edited. Doing so is not allowed. Bot exiting!") quit(1) -API_KEY = os.environ.get('API_KEY', None) -API_HASH = os.environ.get('API_HASH',None) -LOGGER_GROUP=os.environ.get('LOGGER_GROUP',None) -LOGGER=os.environ.get('LOGGER',None) #Incase you want to turn off logging, put this to false -PM_AUTO_BAN=os.environ.get('PM_AUTO_BAN',None) -CONSOLE_LOGGER_VERBOSE=os.environ.get('CONSOLE_LOGGER_VERBOSE',None) -DB_URI=os.environ.get('DB_URI',None) -if CONSOLE_LOGGER_VERBOSE: - logging.basicConfig( - format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", - level=logging.DEBUG) - LOGS = logging.getLogger(__name__) -bot = TelegramClient('userbot',API_KEY,API_HASH) # Global Variables SNIPE_TEXT="" COUNT_MSG=0