modified: bot.py

This commit is contained in:
SimolZimol
2025-11-07 19:47:44 +01:00
parent 4d422068b6
commit cb91f4884a

42
bot.py
View File

@@ -5010,7 +5010,7 @@ async def warn(ctx, user: discord.User, reason: str = "No reason provided", mess
# Send response based on silent mode
if silent:
# Silent mode: only ephemeral response to moderator
# Silent mode: ephemeral response to moderator at command location
silent_embed = discord.Embed(
title="🔇 Silent Warning Issued",
description=f"{user.mention} has been warned silently.",
@@ -5028,7 +5028,24 @@ async def warn(ctx, user: discord.User, reason: str = "No reason provided", mess
silent_embed.set_footer(text=f"Silent Mode • User ID: {user.id}")
silent_embed.set_thumbnail(url=user.display_avatar.url)
await send_response(embed=silent_embed, ephemeral=True)
# Force ephemeral response regardless of command type
if is_slash_command:
if hasattr(ctx, 'followup') and ctx.followup:
await ctx.followup.send(embed=silent_embed, ephemeral=True)
elif hasattr(ctx, 'response') and not ctx.response.is_done():
await ctx.response.send_message(embed=silent_embed, ephemeral=True)
else:
# Fallback for slash commands without proper response
await ctx.send(embed=silent_embed, ephemeral=True)
else:
# For prefix commands, send ephemeral-like message (delete after short time)
msg = await ctx.send(embed=silent_embed)
# Auto-delete after 30 seconds for prefix commands
await asyncio.sleep(30)
try:
await msg.delete()
except:
pass
else:
# Normal mode: public response
await send_response(embed=embed)
@@ -6568,7 +6585,7 @@ async def mute(ctx, user: discord.User, duration: str, reason: str = "No reason
# Send response based on silent mode
if silent:
# Silent mode: only ephemeral response to moderator
# Silent mode: ephemeral response to moderator at command location
silent_embed = discord.Embed(
title="🔇 Silent Mute Applied",
description=f"{user.mention} has been muted silently.",
@@ -6587,7 +6604,24 @@ async def mute(ctx, user: discord.User, duration: str, reason: str = "No reason
silent_embed.set_footer(text=f"Silent Mode • User ID: {user.id} | Use /viewmute {mute_id} for details")
silent_embed.set_thumbnail(url=user.display_avatar.url)
await send_response(embed=silent_embed, ephemeral=True)
# Force ephemeral response regardless of command type
if is_slash_command:
if hasattr(ctx, 'followup') and ctx.followup:
await ctx.followup.send(embed=silent_embed, ephemeral=True)
elif hasattr(ctx, 'response') and not ctx.response.is_done():
await ctx.response.send_message(embed=silent_embed, ephemeral=True)
else:
# Fallback for slash commands without proper response
await ctx.send(embed=silent_embed, ephemeral=True)
else:
# For prefix commands, send ephemeral-like message (delete after short time)
msg = await ctx.send(embed=silent_embed)
# Auto-delete after 30 seconds for prefix commands
await asyncio.sleep(30)
try:
await msg.delete()
except:
pass
else:
# Normal mode: public response
await send_response(embed=embed)