diff --git a/hikka/_internal.py b/hikka/_internal.py index 4d39b85..bd66348 100644 --- a/hikka/_internal.py +++ b/hikka/_internal.py @@ -47,6 +47,18 @@ def restart(): if "--sandbox" in " ".join(sys.argv): exit(0) + if "HIKKA_DO_NOT_RESTART2" in os.environ: + print( + "Got in a loop, exiting\nYou probably need to manually remove existing" + " packages and then restart Heroku. Run `pip uninstall -y telethon" + " telethon-mod hikka-tl-new`, then restart Heroku." + ) + sys.exit(0) + + logging.getLogger().setLevel(logging.CRITICAL) + + print("🔄 Restarting...") + if "LAVHOST" in os.environ: os.system("lavhost restart")