From 02609a65e51022ba1e536ea82e6a1d53fa8fcfe2 Mon Sep 17 00:00:00 2001 From: Lukas Blacha Date: Tue, 7 Feb 2023 23:12:03 +0100 Subject: [PATCH] Added Shutdown-Command with cleanup --- Music-Bot.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Music-Bot.py b/Music-Bot.py index 5b67bec..3fec327 100644 --- a/Music-Bot.py +++ b/Music-Bot.py @@ -105,10 +105,11 @@ else: @bot.command(name="Shutdown") async def _shutdown(ctx): files = os.listdir(cache_dir) - for file in files: - os.remove(f"{cache_dir}/{file}") - await ctx.send(f"{success}Cleaned up {len(files)}...\nShutting down...") - #await bot.close + async with ctx.channel.typing(): + for file in files: + os.remove(f"{cache_dir}/{file}") + await ctx.send(f"{warning}Cleaned up {len(files)} Files...\n\n{success}Shutting down...") + await bot.close @bot.slash_command(name="join", description="Summon the bot into your channel")