Add gurtleaveothers command
This commit is contained in:
parent
0fb92097d4
commit
77bdac8827
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user