From 2c3946b67d00cb720a314b07ab2d75002b51f646 Mon Sep 17 00:00:00 2001 From: ctih1 Date: Sat, 26 Jul 2025 22:29:10 +0300 Subject: [PATCH] Improved updater --- assets/cogs/internal/base_commands.py | 3 ++- updater.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/cogs/internal/base_commands.py b/assets/cogs/internal/base_commands.py index 47c2f8b..711f9b0 100644 --- a/assets/cogs/internal/base_commands.py +++ b/assets/cogs/internal/base_commands.py @@ -184,7 +184,8 @@ class BaseCommands(commands.Cog): async def force_update(self, ctx: commands.Context): await ctx.send("Forcefully updating...") subprocess.run([sys.executable, sys.executable, "updater.py"]) - exit() + os.execv(sys.executable, [sys.executable] + sys.argv) + @requires_admin() @commands.command() diff --git a/updater.py b/updater.py index 62295e0..c55f65b 100644 --- a/updater.py +++ b/updater.py @@ -14,7 +14,5 @@ def force_update() -> None: pull = subprocess.run(["git", "pull", "origin", "main"], check=True, capture_output=True) logger.info(pull) - logger.info("Starting bot") - os.execv(sys.executable, [sys.executable, "bot.py"]) force_update() \ No newline at end of file