add delall cmd
This commit is contained in:
1 parent
c82bb3bd3c
commit
f4ef3e9cd8
1 file changed
+16
-1
+16
-1
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user