diff --git a/src/interactions/modals/ticketModals.js b/src/interactions/modals/ticketModals.js new file mode 100644 index 0000000000..dbcd0ea4a2 --- /dev/null +++ b/src/interactions/modals/ticketModals.js @@ -0,0 +1,19 @@ +import TicketService from '../../services/ticketService.js'; + +export default [ + { + name: 'ticket_rename_modal', + async execute(interaction) { + const newName = interaction.fields.getTextInputValue('new_ticket_name'); + const ticketService = new TicketService(interaction.client); + + try { + await interaction.deferReply(); + await ticketService.renameTicket(interaction.channel, newName); + await interaction.editReply(`✏️ Ticket renamed to **${newName}**`); + } catch (error) { + await interaction.editReply('❌ Error renaming ticket'); + } + }, + }, +];