From 84d4f1b2bde7f613b6dfc5d54c9d30b457eeaf4b Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Thu, 25 Apr 2024 18:42:18 +0530 Subject: [PATCH 1/2] Add `/nuke` command to commands registry database --- config/commands.json | 524 ++++++++++++++++++++++--------------------- 1 file changed, 267 insertions(+), 257 deletions(-) diff --git a/config/commands.json b/config/commands.json index af283c3..59aa2d9 100644 --- a/config/commands.json +++ b/config/commands.json @@ -510,323 +510,333 @@ "bugged": false }, "automod": { - "name": "Show Automod Server Configuration", - "description": "Shows the current configuration of your server's automod system.", - "type": "automod", - "cooldown": null, - "args": null, - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Show Automod Server Configuration", + "description": "Shows the current configuration of your server's automod system.", + "type": "automod", + "cooldown": null, + "args": null, + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "automod_swearfilter": { - "name": "Toggle Automod Swear-filter", - "description": "Lets you turn on or off the automod swear-filter for your server.", - "type": "automod", - "cooldown": null, - "args": ["toggle"], - "usable_by": "server admins", - "disabled": false, - "bugged": false + "name": "Toggle Automod Swear-filter", + "description": "Lets you turn on or off the automod swear-filter for your server.", + "type": "automod", + "cooldown": null, + "args": ["toggle"], + "usable_by": "server admins", + "disabled": false, + "bugged": false }, "automod_linkblocker": { - "name": "Toggle Automod Link Blocker", - "description": "Lets you turn on or off the automod link-blocker for your server.", - "type": "automod", - "cooldown": null, - "args": ["toggle"], - "usable_by": "server admins", - "disabled": false, - "bugged": false + "name": "Toggle Automod Link Blocker", + "description": "Lets you turn on or off the automod link-blocker for your server.", + "type": "automod", + "cooldown": null, + "args": ["toggle"], + "usable_by": "server admins", + "disabled": false, + "bugged": false }, "squareroot": { - "name": "Square Root", - "description": "Finds the square root of any positive number.", - "type": "maths", - "cooldown": null, - "args": ["number"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Square Root", + "description": "Finds the square root of any positive number.", + "type": "maths", + "cooldown": null, + "args": ["number"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "area square": { - "name": "Square Area ", - "description": "Finds the area of a square.", - "type": "maths", - "cooldown": null, - "args": ["length"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Square Area ", + "description": "Finds the area of a square.", + "type": "maths", + "cooldown": null, + "args": ["length"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "area rectangle": { - "name": "Rectangle Area", - "description": "Finds the area of a rectangle.", - "type": "maths", - "cooldown": null, - "args": ["length", "breadth"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Rectangle Area", + "description": "Finds the area of a rectangle.", + "type": "maths", + "cooldown": null, + "args": ["length", "breadth"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "area circle": { - "name": "Circle Area", - "description": "Finds the area of a circle. (Takes π as 22/7)", - "type": "maths", - "cooldown": null, - "args": ["radius"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Circle Area", + "description": "Finds the area of a circle. (Takes π as 22/7)", + "type": "maths", + "cooldown": null, + "args": ["radius"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "area triangle": { - "name": "Triangle Area", - "description": "Finds the area of a triangle. (Uses Heron's formula)", - "type": "maths", - "cooldown": null, - "args": ["side_length_a", "side_length_b", "side_length_c"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Triangle Area", + "description": "Finds the area of a triangle. (Uses Heron's formula)", + "type": "maths", + "cooldown": null, + "args": ["side_length_a", "side_length_b", "side_length_c"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "cog load": { - "name": "Load Cog", - "description": "Loads a cog.", - "type": "DevTools", - "cooldown": null, - "args": ["cog"], - "usable_by": "the developer", - "disabled": false, - "bugged": false + "name": "Load Cog", + "description": "Loads a cog.", + "type": "DevTools", + "cooldown": null, + "args": ["cog"], + "usable_by": "the developer", + "disabled": false, + "bugged": false }, "cog disable": { - "name": "Disable Cog", - "description": "Disables a cog.", - "type": "DevTools", - "cooldown": null, - "args": ["cog"], - "usable_by": "the developer", - "disabled": false, - "bugged": false + "name": "Disable Cog", + "description": "Disables a cog.", + "type": "DevTools", + "cooldown": null, + "args": ["cog"], + "usable_by": "the developer", + "disabled": false, + "bugged": false }, "cog reload": { - "name": "Reload Cog", - "description": "Reloads a cog.", - "type": "DevTools", - "cooldown": null, - "args": ["cog"], - "usable_by": "the developer", - "disabled": false, - "bugged": false + "name": "Reload Cog", + "description": "Reloads a cog.", + "type": "DevTools", + "cooldown": null, + "args": ["cog"], + "usable_by": "the developer", + "disabled": false, + "bugged": false }, "treasury": { - "name": "Treasury", - "description": "View the amount of coins in the isobot treasury.", - "type": "economy system", - "cooldown": null, - "args": null, - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Treasury", + "description": "View the amount of coins in the isobot treasury.", + "type": "economy system", + "cooldown": null, + "args": null, + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "kill": { - "name": "Kill", - "description": "Kill someone for cash and rewards!", - "type": "economy system", - "cooldown": 15, - "args": ["target"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Kill", + "description": "Kill someone for cash and rewards!", + "type": "economy system", + "cooldown": 15, + "args": ["target"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "leaderboard_levels": { - "name": "Levelling Leaderboard", - "description": "See the global leaderboard for user levels.", - "type": "levelling", - "cooldown": null, - "args": null, - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Levelling Leaderboard", + "description": "See the global leaderboard for user levels.", + "type": "levelling", + "cooldown": null, + "args": null, + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "leaderboard_nw": { - "name": "Net Worth Leaderboard", - "description": "See the global leaderboard for user net worth.", - "type": "economy system", - "cooldown": null, - "args": null, - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Net Worth Leaderboard", + "description": "See the global leaderboard for user net worth.", + "type": "economy system", + "cooldown": null, + "args": null, + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "weather": { - "name": "Weather", - "description": "See the current weather conditions of your set location, or another location.", - "type": "weather", - "cooldown": null, - "args": ["location (optional, configurable by /weather_set_location)"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Weather", + "description": "See the current weather conditions of your set location, or another location.", + "type": "weather", + "cooldown": null, + "args": ["location (optional, configurable by /weather_set_location)"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "weather_set_location": { - "name": "Set weather default location", - "description": "Set your default location for the `/weather` command.", - "type": "weather", - "cooldown": null, - "args": ["location"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Set weather default location", + "description": "Set your default location for the `/weather` command.", + "type": "weather", + "cooldown": null, + "args": ["location"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "weather_set_scale": { - "name": "Set weather temperature unit scale", - "description": "Set your preferred unit scale for temperature for the `/weather` command.", - "type": "weather", - "cooldown": null, - "args": ["scale"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Set weather temperature unit scale", + "description": "Set your preferred unit scale for temperature for the `/weather` command.", + "type": "weather", + "cooldown": null, + "args": ["scale"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "chatgpt": { - "name": "ChatGPT", - "description": "Talk to ChatGPT and get a response back.", - "type": "general utilities", - "cooldown": 1, - "args": ["message"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "ChatGPT", + "description": "Talk to ChatGPT and get a response back.", + "type": "general utilities", + "cooldown": 1, + "args": ["message"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "generate_image": { - "name": "Image Generation", - "description": "Generate an image of your choice using the DALL-E modal.", - "type": "general utilities", - "cooldown": 10, - "args": ["prompt", "resolution (optional)"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Image Generation", + "description": "Generate an image of your choice using the DALL-E modal.", + "type": "general utilities", + "cooldown": 10, + "args": ["prompt", "resolution (optional)"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "owoify": { - "name": "Owoify", - "description": "Lets you owoify any text you want (uwu girl moment)", - "type": "fun", - "cooldown": null, - "args": ["text"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Owoify", + "description": "Lets you owoify any text you want (uwu girl moment)", + "type": "fun", + "cooldown": null, + "args": ["text"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "hackertext": { - "name": "Hacker Text", - "description": "Turns your text into m4st3r h4xx0r text to make yourself look like a skid", - "type": "fun", - "cooldown": null, - "args": ["text"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Hacker Text", + "description": "Turns your text into m4st3r h4xx0r text to make yourself look like a skid", + "type": "fun", + "cooldown": null, + "args": ["text"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "math volume_cuboid": { - "name": "Cuboid Volume", - "description": "Find the volume of a cuboid.\n This command can also be used to find the volume of a cube, by leaving out the `breadth` and `height` arguments.", - "type": "maths", - "cooldown": null, - "args": ["length", "breadth (optional)", "height (optional)"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Cuboid Volume", + "description": "Find the volume of a cuboid.\n This command can also be used to find the volume of a cube, by leaving out the `breadth` and `height` arguments.", + "type": "maths", + "cooldown": null, + "args": ["length", "breadth (optional)", "height (optional)"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "math volume_sphere": { - "name": "Sphere Volume", - "description": "Find the volume of a sphere using radius.", - "type": "maths", - "cooldown": null, - "args": ["radius"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Sphere Volume", + "description": "Find the volume of a sphere using radius.", + "type": "maths", + "cooldown": null, + "args": ["radius"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "math volume_hemisphere": { - "name": "Hemisphere Volume", - "description": "Find the volume of a hemisphere using radius.", - "type": "maths", - "cooldown": null, - "args": ["radius"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Hemisphere Volume", + "description": "Find the volume of a hemisphere using radius.", + "type": "maths", + "cooldown": null, + "args": ["radius"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "math volume_cone": { - "name": "Cone Volume", - "description": "Find the volume of a cone using base radius and height.", - "type": "maths", - "cooldown": null, - "args": ["radius", "height"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Cone Volume", + "description": "Find the volume of a cone using base radius and height.", + "type": "maths", + "cooldown": null, + "args": ["radius", "height"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "math volume_cylinder": { - "name": "Cylinder Volume", - "description": "Find the volume of a cylinder using radius and height.", - "type": "maths", - "cooldown": null, - "args": ["radius", "height"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Cylinder Volume", + "description": "Find the volume of a cylinder using radius and height.", + "type": "maths", + "cooldown": null, + "args": ["radius", "height"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "math surfacearea_cuboid": { - "name": "Cuboid Surface Area", - "description": "Find the surface area of a cuboid.", - "type": "maths", - "cooldown": null, - "args": ["length", "breadth (optional)", "height (optional)"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Cuboid Surface Area", + "description": "Find the surface area of a cuboid.", + "type": "maths", + "cooldown": null, + "args": ["length", "breadth (optional)", "height (optional)"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "math surfacearea_sphere": { - "name": "Sphere Surface Area", - "description": "Find the surface area of a sphere using radius.", - "type": "maths", - "cooldown": null, - "args": ["radius"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Sphere Surface Area", + "description": "Find the surface area of a sphere using radius.", + "type": "maths", + "cooldown": null, + "args": ["radius"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "math surfacearea_hemisphere": { - "name": "Hemisphere Surface Area", - "description": "Find the surface area of a hemisphere using radius.", - "type": "maths", - "cooldown": null, - "args": ["mode", "radius"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Hemisphere Surface Area", + "description": "Find the surface area of a hemisphere using radius.", + "type": "maths", + "cooldown": null, + "args": ["mode", "radius"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "math surfacearea_cylinder": { - "name": "Cylinder Surface Area", - "description": "Find the surface area of a cylinder using radius and height.", - "type": "maths", - "cooldown": null, - "args": ["mode", "radius", "height"], - "usable_by": "everyone", - "disabled": false, - "bugged": false + "name": "Cylinder Surface Area", + "description": "Find the surface area of a cylinder using radius and height.", + "type": "maths", + "cooldown": null, + "args": ["mode", "radius", "height"], + "usable_by": "everyone", + "disabled": false, + "bugged": false }, "math surfacearea_cone": { - "name": "Cone Surface Area", - "description": "Find the surface area of a cone using radius and height.", - "type": "maths", - "cooldown": null, - "args": ["mode", "radius", "height"], - "usable_by": "everyone", - "disabled": false, - "bugged": false - } + "name": "Cone Surface Area", + "description": "Find the surface area of a cone using radius and height.", + "type": "maths", + "cooldown": null, + "args": ["mode", "radius", "height"], + "usable_by": "everyone", + "disabled": false, + "bugged": false + }, + "nuke": { + "name": "Nuke", + "description": "Completely wipes a text channel in the server.", + "type": "general utilities", + "cooldown": null, + "args": ["channel"], + "usable_by": "server admins", + "disabled": false, + "bugged": false + } } From e182141745e840090c93fc8213e529dadc793727 Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Thu, 25 Apr 2024 18:42:52 +0530 Subject: [PATCH 2/2] Add `/nuke` command to let server admins completely wipe channels clean --- cogs/utils.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cogs/utils.py b/cogs/utils.py index 7aaca10..8b77a13 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -297,6 +297,27 @@ async def vote(self, ctx: ApplicationContext): localembed.set_footer(text="Thank you for your support!") await ctx.respond(embed=localembed) + @commands.slash_command( + name="nuke", + description="Completely wipes a text channel in the server." + ) + @option(name="channel", description="The channel you want to nuke.", type=discord.TextChannel) + async def nuke(self, ctx: ApplicationContext, channel: discord.TextChannel): + """Completely wipes a text channel in the server.""" + if not ctx.author.guild_permissions.administrator: + return await ctx.respond( + "You can't use this command! You need the `Administrator` permission in this server to run this command.", + ephemeral=True + ) + localembed = discord.Embed( + description=f":white_check_mark: Channel `#{channel.name}` successfully nuked.", + color=discord.Color.green() + ) + new_channel = await channel.clone(reason=f"Channel has been nuked by {ctx.author.name}") + await channel.delete(reason=f"Channel has been nuked by {ctx.author.name}") + await new_channel.send(f"Channel nuked by **{ctx.author.name}**!") + await ctx.respond(embed=localembed, ephemeral=True) + commandmanager = SlashCommandGroup("commandmanager", "Manage isobot's command registry.") @commandmanager.command(