Added Shutdown-Command

This commit is contained in:
Lukas Blacha
2023-02-07 23:02:51 +01:00
parent f87f878ca4
commit 9540f37d06

View File

@@ -101,6 +101,13 @@ else:
print("------") 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") @bot.slash_command(name="join", description="Summon the bot into your channel")
async def join(ctx: commands.Context): async def join(ctx: commands.Context):
try: try:
@@ -224,7 +231,6 @@ else:
bot.loop.run_until_complete(bot.start(token=args.token, reconnect=True)) bot.loop.run_until_complete(bot.start(token=args.token, reconnect=True))
except KeyboardInterrupt: except KeyboardInterrupt:
bot.loop.run_until_complete(bot.close()) bot.loop.run_until_complete(bot.close())
os.remove("cache/*")
finally: finally:
bot.loop.close() bot.loop.close()