From f4ef3e9cd8997354fe6d63750e5987c5f15a1c06 Mon Sep 17 00:00:00 2001 From: un1xx Date: Mon, 12 May 2025 21:31:23 +0530 Subject: [PATCH] add delall cmd --- exts/war_monitor.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/exts/war_monitor.py b/exts/war_monitor.py index 70a7479..004b1db 100644 --- a/exts/war_monitor.py +++ b/exts/war_monitor.py @@ -480,7 +480,7 @@ class WarMonitor(commands.Cog): await ctx.send(f"this command only works inside {category.name}") return await ctx.channel.edit(category=(await self.bot.fetch_channel(ARCHIVE_CATEGORY))) - await ctx.channel.send("channel moved to archived category") + await ctx.channel.send("> channel moved to archive, you can also do fr delete to delete the channel or fr delall to delete all channels in archive.") # sync perms to archive category await ctx.channel.edit(sync_permissions=True) @@ -504,6 +504,21 @@ class WarMonitor(commands.Cog): await ctx.send(f"this command only works inside {category.name}") return await ctx.channel.delete() + + @commands.command() + @commands.has_permissions(administrator=True) + @commands.has_role("The Croak Council") + async def deall(self, ctx: CustomCtx): + category = await self.bot.fetch_channel(ARCHIVE_CATEGORY) + if ctx.channel not in category.text_channels: + await ctx.send(f"this command only works inside {category.name}") + return + for channel in category.text_channels: + try: + await channel.delete() + except Exception as e: + await ctx.send(f"failed to delete channel: {e}") + @commands.command() async def monitored(self, ctx: CustomCtx):