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.
This commit is contained in:
@@ -30,7 +30,6 @@ from discordbot.moderation import (
|
|||||||
moderation_slash_warn,
|
moderation_slash_warn,
|
||||||
moderation_slash_inspect,
|
moderation_slash_inspect,
|
||||||
moderation_ctx_warn_author,
|
moderation_ctx_warn_author,
|
||||||
moderation_ctx_inspect_author,
|
|
||||||
moderation_slash_say,
|
moderation_slash_say,
|
||||||
)
|
)
|
||||||
from discordbot.welcome import sendWelcomeMessage, sendLeaveMessage, updateInviteCache
|
from discordbot.welcome import sendWelcomeMessage, sendLeaveMessage, updateInviteCache
|
||||||
@@ -57,7 +56,6 @@ class DiscordBot(discord.Client):
|
|||||||
moderation_slash_warn,
|
moderation_slash_warn,
|
||||||
moderation_slash_inspect,
|
moderation_slash_inspect,
|
||||||
moderation_ctx_warn_author,
|
moderation_ctx_warn_author,
|
||||||
moderation_ctx_inspect_author,
|
|
||||||
moderation_slash_say,
|
moderation_slash_say,
|
||||||
protondb_slash_command,
|
protondb_slash_command,
|
||||||
pdb_slash_command,
|
pdb_slash_command,
|
||||||
|
|||||||
@@ -1005,7 +1005,6 @@ async def handle_staff_help_command(message: Message, bot):
|
|||||||
name="🔎 Inspection",
|
name="🔎 Inspection",
|
||||||
value=(
|
value=(
|
||||||
"• `/inspect` — membre (réponse visible seulement par vous)\n"
|
"• `/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"
|
"• `!inspect @utilisateur` ou `!inspect id`\n"
|
||||||
" Affiche les infos dans le salon puis supprime la commande\n"
|
" Affiche les infos dans le salon puis supprime la commande\n"
|
||||||
"Ex: `!inspect @User`"
|
"Ex: `!inspect @User`"
|
||||||
@@ -2202,22 +2201,7 @@ async def moderation_ctx_warn_author(interaction: discord.Interaction, message:
|
|||||||
return
|
return
|
||||||
await interaction.response.send_modal(WarnAuthorModal(message))
|
await interaction.response.send_modal(WarnAuthorModal(message))
|
||||||
|
|
||||||
@app_commands.context_menu(name="Inspecter l'auteur")
|
# Pas de menu contextuel « Inspecter l'auteur » : Discord limite à 5 les commandes message globales (transfert, ban, kick, timeout, avertir).
|
||||||
@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)
|
|
||||||
|
|
||||||
@app_commands.context_menu(name="Bannir l'auteur")
|
@app_commands.context_menu(name="Bannir l'auteur")
|
||||||
@app_commands.guild_only()
|
@app_commands.guild_only()
|
||||||
|
|||||||
Reference in New Issue
Block a user