Now before creating a new group, the bot deletes previously created channels

This commit is contained in:
trueold89 2024-06-07 18:38:24 +03:00
parent a9ce6a60b9
commit d5f378492f
Signed by: trueold89
GPG Key ID: C122E85DD49E6B30
1 changed files with 4 additions and 0 deletions

View File

@ -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)