From 73b2e6807cbefb85261c3bfa99407daf7f1aaf7d Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Thu, 2 Dec 2021 12:44:30 +0700 Subject: [PATCH] revert --- program/updater.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/program/updater.py b/program/updater.py index 6c4b328..3f78da5 100644 --- a/program/updater.py +++ b/program/updater.py @@ -70,10 +70,8 @@ async def update_repo(_, message: Message): @Client.on_message(command(["restart", f"restart@{BOT_USERNAME}"]) & ~filters.edited) @sudo_users_only async def restart_bot(_, message: Message): - m = await message.reply_text("šŸ”„ `restarting bot...`") - await sleep(3) - os.execl(sys.executable, sys.executable, *sys.argv) - try: - await m.edit("āœ… **Bot restarted successfully.**\n\nā€¢ **You can use this bot again**") - except BaseException: - pass + msg = await message.reply("`restarting bot...`") + args = [sys.executable, "main.py"] + await msg.edit("āœ… bot restarted\n\nā€¢ now you can use this bot again.") + execle(sys.executable, *args, environ) + return