From 0c3048660acec628a7e6ac0ec00393e4d280e8c3 Mon Sep 17 00:00:00 2001 From: Mow910 Date: Sun, 3 May 2026 18:44:13 +0200 Subject: [PATCH] Remove deprecated context menu command for author inspection in moderation module - Eliminated the `Inspecter l'auteur` context menu command due to Discord's limitation on global message commands. - Updated related documentation to reflect the removal of this command, ensuring clarity for users regarding available moderation functionalities. --- discordbot/__init__.py | 2 -- discordbot/moderation.py | 18 +----------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/discordbot/__init__.py b/discordbot/__init__.py index 2291c8f..589c99e 100644 --- a/discordbot/__init__.py +++ b/discordbot/__init__.py @@ -30,7 +30,6 @@ from discordbot.moderation import ( moderation_slash_warn, moderation_slash_inspect, moderation_ctx_warn_author, - moderation_ctx_inspect_author, moderation_slash_say, ) from discordbot.welcome import sendWelcomeMessage, sendLeaveMessage, updateInviteCache @@ -57,7 +56,6 @@ class DiscordBot(discord.Client): moderation_slash_warn, moderation_slash_inspect, moderation_ctx_warn_author, - moderation_ctx_inspect_author, moderation_slash_say, protondb_slash_command, pdb_slash_command, diff --git a/discordbot/moderation.py b/discordbot/moderation.py index 6699eea..b1d2cec 100644 --- a/discordbot/moderation.py +++ b/discordbot/moderation.py @@ -1005,7 +1005,6 @@ async def handle_staff_help_command(message: Message, bot): name="🔎 Inspection", value=( "• `/inspect` — membre (réponse visible seulement par vous)\n" - "• Clic droit sur un message → Applications → **Inspecter l'auteur**\n" "• `!inspect @utilisateur` ou `!inspect id`\n" " Affiche les infos dans le salon puis supprime la commande\n" "Ex: `!inspect @User`" @@ -2202,22 +2201,7 @@ async def moderation_ctx_warn_author(interaction: discord.Interaction, message: return await interaction.response.send_modal(WarnAuthorModal(message)) -@app_commands.context_menu(name="Inspecter l'auteur") -@app_commands.guild_only() -@app_commands.default_permissions(manage_messages=True) -async def moderation_ctx_inspect_author(interaction: discord.Interaction, message: discord.Message): - if not ConfigurationHelper().getValue('moderation_enable'): - await interaction.response.send_message("❌ La modération n'est pas activée sur ce serveur.", ephemeral=True) - return - if not _interaction_must_be_staff_member(interaction): - await interaction.response.send_message( - "❌ Vous n'avez pas les permissions nécessaires pour utiliser cette commande.", - ephemeral=True, - ) - return - await interaction.response.defer(ephemeral=True) - embed = await build_inspect_embed_for_user(interaction.client, interaction.guild, message.author) - await interaction.followup.send(embed=embed, ephemeral=True) +# Pas de menu contextuel « Inspecter l'auteur » : Discord limite à 5 les commandes message globales (transfert, ban, kick, timeout, avertir). @app_commands.context_menu(name="Bannir l'auteur") @app_commands.guild_only()