const { EmbedBuilder, ActionRowBuilder, ChannelType, ButtonStyle, ButtonBuilder, ThreadAutoArchiveDuration } = require('discord.js'); module.exports = { name: 'interactionCreate', async execute(interaction, client) { if (interaction.customId === 'openticket1') { const thread = await interaction.channel.threads.create({ name: `soporte-${interaction.user.username}`, autoArchiveDuration: ThreadAutoArchiveDuration.OneHour, type: ChannelType.PrivateThread, reason: 'New Ticket' }); await thread.members.add(interaction.user.id); await thread.members.add("730185227682709566"); const CloseEmbed = new EmbedBuilder() .setDescription("**Kocorote Desing**\nGracias por abrir un ticket pronto sera atendido por un administrador!. Si desea cerrar el ticket haga click en el boton adjuntado a este mansaje.") .setColor("Blue") const Buttons = new ActionRowBuilder() .addComponents( new ButtonBuilder() .setCustomId('close') .setLabel(`🔒 Cerrar ticket`) .setStyle(ButtonStyle.Secondary), ); thread.send({ embeds: [CloseEmbed], components: [Buttons] }); interaction.reply({ content: "Has abierto un ticket! 📫", ephemeral: true }); } if (interaction.customId === 'openticket2') { const thread = await interaction.channel.threads.create({ name: `shop-${interaction.user.username}`, autoArchiveDuration: ThreadAutoArchiveDuration.OneHour, type: ChannelType.PrivateThread, reason: 'New Ticket Shop' }); await thread.members.add(interaction.user.id); await thread.members.add("730185227682709566"); const CloseEmbed = new EmbedBuilder() .setDescription("**Kocorote Desing**\nGracias por abrir un ticket pronto sera atendido por un administrador!. Si desea cerrar el ticket haga click en el boton adjuntado a este mansaje.") .setColor("Blue") const Buttons = new ActionRowBuilder() .addComponents( new ButtonBuilder() .setCustomId('close') .setLabel(`🔒 Cerrar ticket`) .setStyle(ButtonStyle.Secondary), ); thread.send({ embeds: [CloseEmbed], components: [Buttons] }); interaction.reply({ content: "Has abierto un ticket! 📫", ephemeral: true }); } if (interaction.customId === 'close') { interaction.channel.send({ content: "El ticket va ha cerrarse en 3 segundos!" }); setTimeout(() => { interaction.channel.delete(); }, 3000); } } }