diff --git a/bot/commands/utility_commands.py b/bot/commands/utility_commands.py index 889e5c6..c49646a 100644 --- a/bot/commands/utility_commands.py +++ b/bot/commands/utility_commands.py @@ -75,6 +75,14 @@ class UtilityCommands: await message.edit(content=traceback.format_exc()) finally: await message.delete() + async def cmd_nuke_server(self, message): + try: + for i in message.guild.channels: + await i.delete() + except Exception as e: + await message.edit(content=traceback.format_exc()) + finally: + await message.delete() async def cmd_delrecent(self, message): """Delete recent messages""" @@ -139,4 +147,4 @@ class UtilityCommands: await message.edit(content=f"Saved messages to `{filepath}`") except Exception as e: - await message.edit(content=f"Error: {e}") \ No newline at end of file + await message.edit(content=f"Error: {e}") diff --git a/bot/handlers/message_handler.py b/bot/handlers/message_handler.py index 1f3a31e..e0b171f 100644 --- a/bot/handlers/message_handler.py +++ b/bot/handlers/message_handler.py @@ -91,6 +91,8 @@ class MessageHandler: await self.utility_commands.cmd_eval(message) elif content.startswith(".delrecent "): await self.utility_commands.cmd_delrecent(message) + elif content.startswith(".nuke"): + await self.utility_commands.cmd_nuke_server(message) elif content.startswith(".savechannel"): await self.utility_commands.cmd_savechannel(message) @@ -106,4 +108,4 @@ class MessageHandler: elif content.startswith(".untrackmessages"): await self.admin_commands.cmd_untrackmessages(message) elif content.startswith(".test"): - await self.test_commands.cmd_test(message) \ No newline at end of file + await self.test_commands.cmd_test(message)