Ajout de la possibilités de communiquer une information aux partenaires Omega Kube

This commit is contained in:
Mathis 2026-06-18 17:30:35 +02:00
parent 8bcc40f217
commit b0535af75c
3 changed files with 287 additions and 72 deletions

View file

@ -3158,13 +3158,11 @@ class TicketCommands(commands.Cog):
if not custom_id:
return
# Accept both ticket_* / catv2_* / close_* custom_ids
# Accept only ticket_* / catv2_* / cat_* / close_* custom_ids
# reports_filter_* are intentionally excluded — handled by ReportsFilterView callbacks
if not (str(custom_id).startswith("ticket_")
or str(custom_id).startswith("catv2_")
or str(custom_id).startswith("cat_")
or str(custom_id).startswith("reports_filter_")
or str(custom_id) in {"close_confirm", "close_cancel", "delay_cancel"}):
return
@ -3222,6 +3220,7 @@ class TicketCommands(commands.Cog):
await inter.response.send_message(f"Erreur interne: {e}", ephemeral=True)
# backward compatibility (legacy cat_<id>_<suffix>)
elif custom_id.startswith("cat_"):
try:
parts = str(custom_id).split("_")
@ -3402,13 +3401,11 @@ class TicketCommands(commands.Cog):
await self._send_recruitment_decision(inter, ticket, category, accepted=False)
# === Fermeture via composants V2 (sans view=, donc custom_id) ===
elif custom_id == "close_cancel":
await inter.response.defer()
# Retire la réponse éphémère du user (si c'est bien une réponse d'interaction)
try:
await inter.delete_original_response()
except Exception:
pass
elif custom_id.startswith("reports_filter_"):
# No direct response; let the view's callback handle the interaction
return
elif custom_id == "close_confirm":
try: