From 9540f37d06bcef42936c709d8763942b98e13e1e Mon Sep 17 00:00:00 2001 From: Lukas Blacha Date: Tue, 7 Feb 2023 23:02:51 +0100 Subject: [PATCH] Added Shutdown-Command --- Music-Bot.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Music-Bot.py b/Music-Bot.py index 52b29b4..f4896fe 100644 --- a/Music-Bot.py +++ b/Music-Bot.py @@ -101,6 +101,13 @@ else: print("------") + @bot.command(name="Shutdown") + async def _shutdown(ctx): + os.remove("cache/*") + await ctx.send(f"{success}Shutting down...") + #await bot.close + + @bot.slash_command(name="join", description="Summon the bot into your channel") async def join(ctx: commands.Context): try: @@ -224,7 +231,6 @@ else: bot.loop.run_until_complete(bot.start(token=args.token, reconnect=True)) except KeyboardInterrupt: bot.loop.run_until_complete(bot.close()) - os.remove("cache/*") finally: bot.loop.close()