From d5f378492f31e9fc22f7ca7f9a5aeccba2fdfc5e Mon Sep 17 00:00:00 2001 From: trueold89 Date: Fri, 7 Jun 2024 18:38:24 +0300 Subject: [PATCH] Now before creating a new group, the bot deletes previously created channels --- hellmbot/bot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hellmbot/bot.py b/hellmbot/bot.py index 32c773e..094c929 100644 --- a/hellmbot/bot.py +++ b/hellmbot/bot.py @@ -61,6 +61,10 @@ async def create(ctx: commands.Context) -> None: group = await server.create_category(f"{circles_count} Circles of Hell") await ctx.send("Creating vc's...", ephemeral=True) if db: + channels = db.channels + for channel in channels: + channel = bot.get_channel(channel) + await channel.delete() db.clear_channels() for circle in range(circles_count): vc = await server.create_voice_channel(f"{circle + 1} Circle", category=group)