From 77bdac8827aaab577dfd014327d22b76bf7652c4 Mon Sep 17 00:00:00 2001 From: Slipstream Date: Mon, 9 Jun 2025 16:57:29 +0000 Subject: [PATCH] Add gurtleaveothers command --- gurt/commands.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/gurt/commands.py b/gurt/commands.py index 111fdfc..f53836f 100644 --- a/gurt/commands.py +++ b/gurt/commands.py @@ -1313,6 +1313,37 @@ def setup_commands(cog: "GurtCog"): command_functions.append(gurtresetpersonality) + # --- Gurt Leave Others Command (Owner Only) --- + @cog.bot.tree.command( + name="gurtleaveothers", + description="Leave all guilds except the designated one. (Owner only)", + ) + async def gurtleaveothers(interaction: discord.Interaction): + """Leave all guilds except the target guild.""" + if interaction.user.id != cog.bot.owner_id: + await interaction.response.send_message( + "⛔ Only the bot owner can remove Gurt from guilds.", + ephemeral=True, + ) + return + + await interaction.response.defer(ephemeral=True) + + target_id = 1360706427861209259 + for guild in cog.bot.guilds: + if guild.id != target_id: + try: + await guild.owner.send( + "This bot was manually removed by the bot owner. If you have questions, contact the bot owner directly." + ) + except Exception: + pass + await guild.leave() + + await interaction.followup.send("✅ Done.", ephemeral=True) + + command_functions.append(gurtleaveothers) + # --- Gurt Model Command (Owner Only) --- @cog.bot.tree.command( name="gurtmodel",