Kuby/commandes/ticket/TODO_CONFIRM_DELAY.md

1.8 KiB

Ticket Close Confirmation and Delay - Implementation Plan

Objective

Add confirmation dialog and waiting delay before ticket closure.

Changes to make

1. Create CloseConfirmationView class

  • Yes/No confirmation buttons
  • Cancel option
  • Shows before closing

2. Create CloseDelayView class

  • Countdown display (5 seconds)
  • Progress steps:
    • 📄 Génération du transcript...
    • 📝 Sauvegarde des données...
    • 🗑️ Suppression du canal...
  • Cancel option during delay

3. Modify TicketManagementView._close_callback

  • Show confirmation view first
  • After Yes, show delay view with countdown
  • After delay completes, proceed with closing

Files to modify

  • commandes/ticket/__init__.py

Status

  • Add CloseConfirmationView class
  • Add CloseDelayView class
  • Modify TicketManagementView._close_callback
  • Add cancel button to CloseDelayView
  • Test the flow

Implementation Details

CloseConfirmationView

class CloseConfirmationView(discord.ui.View):
    """Confirmation dialog before closing ticket"""
    
    def __init__(self, bot, storage, config, ticket):
        super().__init__(timeout=60)
        # Yes button (green)
        # No button (red) - cancels and removes message

CloseDelayView

class CloseDelayView(discord.ui.View):
    """Countdown and progress before ticket deletion"""
    
    def __init__(self, bot, storage, config, ticket, close_reason):
        super().__init__(timeout=None)
        # Disable all buttons during countdown
        # Update embed with countdown
        # After delay, call actual close function

Flow

  1. User clicks "Fermer"
  2. Show confirmation embed with Yes/No buttons
  3. If Yes → Show delay view with countdown
  4. After delay → Close ticket and delete channel
  5. If No or timeout → Remove confirmation message